摘要:
/* 用颜色的单词表示不同的颜色:red, green, blue等等 */ p { background-color: red; } /* 用rgb三元色表示,rgb => red, green, blue rgb的浓度值:r(0~255), g(0~255), b(0~255) */ p { background-color: rgb(0, 0, 255); /... 阅读全文
摘要:
/** * 非布尔值的与(&&)与或(||)运算 * 1.先将其转换成布尔值再做运算,并且返回原值 * 2.与(&&)运算: * a.如果第一个值为true,则返回第二个值 * b.如果第一个值为false,则直接返回第一个值 * 3.或(||)运算 * a.如果第一个值为true,则直接返回第一个值 * b.如果第一个值为false,则返回第二个值 */ // true && false con 阅读全文
摘要:
/** * 自增(++)与自减(--)运算符 */ // 自增示例 var a = 1, c, d, e; console.log(`a++ = ${a++}`); // a++ = 1 console.log(`a = ${a}`); // a = 2 c = a++; console.log(`c = ${c}`); // c = 2 console.log(`a = ${a}`); // a 阅读全文