摘要: Array.shift()shift() 方法用在数组上, 移除数组的第一个元素并返回移除的元素. 该方法会改变原数组的长度.const array1 = [1, 2, 3];const firstElement = array1.shift();console.log(array1); // Ex 阅读全文
posted @ 2023-08-22 10:58 weimiu 阅读(143) 评论(0) 推荐(0) 编辑
摘要: console.log() 其一、主要表示:向 Web 控制台输出一条消息; 其二、而具体是什么信息就以传递的实参为准,然后就是在控制台就能显示自己传递参数的结果; console.log([1,3,5,7]) // 输出 [1, 3, 5, 7]console.log({}) // 输出 {}co 阅读全文
posted @ 2023-08-21 16:06 weimiu 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 假设有一串字符串"186 186 150 200 160 130 197 200";现在求它的最长升序子串长度。let str ="186 186 150 200 160 130 197 200";let arr = str.split(" "); // 转化为数组let arrLeft = []; 阅读全文
posted @ 2023-08-21 14:45 weimiu 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 大小写转化:("HelloWorld").toLowerCase(); // helloworld("HelloWorld").toUpperCase(); // HELLOWORLD字符与ASCII码: ("A").charCodeAt(); // 65String.fromCharCode(65 阅读全文
posted @ 2023-08-21 13:53 weimiu 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 通过toString将数字转化为对应进制的字符串:var num = 12;num.toString(2); //转换成二进制 1100num.toString(8); //转换成八进制 14num.toString(16); //转换成十六进制 c通过parseInt将数字字符按指定的进制转化为十 阅读全文
posted @ 2023-08-21 13:22 weimiu 阅读(10) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示