案例20190522

    xiaoxiao2022-07-02  117

    1)parseInt(’+1’) //1 2)parseInt(’.3’) // NaN 3)var a = 77, b = 66.2148; console.log(a.toString(2)); console.log(b.toFixed(3));写出输出的内容//1001101 66.215 4*) Boolean()是将一个值转换为其对应的Boolean值。 有哪五种条件转换Boolean值为false? 例Boolean(false) // “”,false,0,null,undefined,NaN 5) isNaN(Number(‘Hello123’)) // true 6) var a = 1; console.log(a+++a–+a+++a—a-++a); // 1+2+1+2-1-2 7)var a = 3; a+=3; a+=3; a+=3; a-=2; a*=2; a/=5; a%=3; console.log(a); //1 8) var a=1; var b=“2a”; console.log(a>b); //false 9) var a=1; var b=“2a”; console.log(a<b); //false 10)拓展 console.log(“a” > “A”); //true 11) var a = 21; var b = 37; console.log(a&b); console.log(a|b); console.log(a^b); //5 53 48

    最新回复(0)