批改状态:合格
老师批语:
// 1. 命名函数function getName(username) {return 'Hello ' + username;}// 2. 匿名函数let getUserName = function(username) {return 'Hello ' + username;};// 3. 箭头函数,用来简化匿名函数的声明add = () => console.log(34 + 88);
// 1. 原始类型: number(1), string('a'), boolean(true,false),undefined(声明了变量,但是没赋值), null// 2. 引用类型, array(数组), object(//对象), function(函数)//数组:const arr = [1, 'admin', [1, 2, 3], true];//对象let obj = {id: 1,username: 'jack',num: [1, 2, 3],isOk: true,'my email': '498668472@qq.com',};//函数function getUser(obj) {return 'id =' + obj.id + ', username =' + obj.username;}getUser(obj);
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号