console.log(Number.MAX_SAFE_INTEGER)
结果
9007199254740991
...
4年前 (2021-09-06)
喜欢
js使用Number.parseInt(b)将数字转为整数
let b = 11.1
console.log(Number.parseInt(b))
结果
11
...
4年前 (2021-09-06)
喜欢
js使用Number.isInteger(a)判断是否是整数
let a = 11
let b = 11.1
console.log(Number.isInteger(a))
console.log(Number.isInteger(b))
结果
true
false
...
4年前 (2021-09-06)
喜欢
使用Number.isNaN(NaN)判断是否是NaN
console.log(Number.isNaN(NaN))
返回结果
true
...
4年前 (2021-09-06)
喜欢
判断是否为纯数字
let a = 11
console.log(Number.isFinite(a))
console.log(Number.isFinite('wanjunshijie'))
console.log(Number.isFinite(NaN))
console.l...
4年前 (2021-09-06)
喜欢
八进制 Octal
let octal = 0o666
console.log(octal)
结果 438
...
4年前 (2021-09-06)
喜欢
//声明二进制 Binary
let Binary = 0B01010;
console.log(Binary)
执行结果
10
...
4年前 (2021-09-06)
喜欢
repeat
document.write('wanjunshijie|'.repeat(3));
执行结果
...
4年前 (2021-09-06)
喜欢
endsWith
判断字符串结尾有没有指定字符
var blog = '这是测试内容wanjunshijie'
document.write(blog.endsWith('wanjunshijie'));
document.write('-...
4年前 (2021-09-06)
喜欢
startsWith
判断字符串开头是否包含指定字符串
var blog = '这是测试内容wanjunshijie'
document.write(blog.startsWith('这是'));
document.write('-----...
4年前 (2021-09-06)
喜欢