批改状态:合格
老师批语:作业的标题不要带有时间,可以根据作业内容总结标题
let num1 = 0, num2 = 0, str1 = '';num1 = 2;num2 = num1 * 20;str1 = 'hello php.cn';console.log(num1, num2, str1);console.log('------------------');console.log(`${num1}`, typeof num1, `${num2}`, typeof num2, `${str1}`, typeof str1);const STR_ADDR = 'China';console.log(STR_ADDR, typeof STR_ADDR);console.log('------------------');// 函数类型1function add(a, b) {return a + b;}console.log(`${num1} add ${num2} = ` + add(num1, num2));// 函数类型2let add2 = function (a, b) {return a + b * 2;}console.log(`${num1} add2 ${num2} = ` + add2(num1, num2));//函数类型3let add3 = (a, b) => {return a + b * 3;}console.log(`${num1} add3 ${num2} = ` + add3(num1, num2));//函数类型4((a, b) => {console.log(`${num1} add4 ${num2} = ` + (num1 + num2 * 4))}) (num1, num2);console.log('------------------');let varBoolean = (num1 > num2);console.log('varBoolean:'+varBoolean, typeof varBoolean);let varStrconsole.log('varStr:'+varStr, typeof varStr);console.log(null, typeof null);console.log('------------------');
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号