bottonName = bottonName || 'first';
bottonName = bottonName || 'first';//字符串的或操作該怎么理解,真的全靠猜?。。。。╞ottonName為空then bottonName='first';bottonName不為空then bottonName=bottonName ?嗎???)
bottonName = bottonName || 'first';//字符串的或操作該怎么理解,真的全靠猜?。。。。╞ottonName為空then bottonName='first';bottonName不為空then bottonName=bottonName ?嗎???)
2016-08-26
舉報
2016-08-26
如果存在bottonName,則bootonName=bottonName,否則,bottonName=first
2018-09-19
我也是才明白。原來這與運算符的優(yōu)先級有關。
a=b||c
b為真(b不等于0)則a=b不管c;
若b為假(b=0)則a=c
2016-12-16
關于這個語法介紹過嗎?
bottonName = bottonName || 'first';
記不起來了。
2016-09-12
點擊第一個按鈕時,bottonName是undefined,所以顯示first,點擊第二個按鈕時last傳參給bottonName,變成有值了,所以是last.