随笔分类 -  JS

基础
摘要:JS类型转换 简介: 基础数据类型: Number、String、Boolean、null、undefined、Symbol(function???); 引用数据类型: Date、Object、Array; 1、直接转换法 转换成十进制类型Number(); Number([]) ⇒ 0; Numb 阅读全文
posted @ 2022-01-13 16:07 lutwelve 阅读(60) 评论(0) 推荐(0)
摘要:JS基础数学[运算符] 算术运算符 ** 幂(2 * 3 2 * 2 * 2, 等同于Math.pow(2, 3)); % 求余或者取模(8 % 3 余2); 赋值运算符 加法赋值 x += 1 x = x + 1; 减法赋值 x -= 1 x = x - 1; 乘法赋值 *x = 1 x = x 阅读全文
posted @ 2022-01-13 16:04 lutwelve 阅读(42) 评论(0) 推荐(0)
摘要:1、console对象 1、输出信息: console.info()别名 console.log(); 2、复合类型表格展示 console.table(obj) || console.table(Array); 3、error('error') 输出出错信息; warn('hey') 输出警告信息 阅读全文
posted @ 2022-01-13 15:57 lutwelve 阅读(175) 评论(0) 推荐(0)