索引:
1,parseFLoat(n);
2,parseInt(n);
3,Number(n);
4,Number.MAX_VALUE;
5,Number.MIN_VALUE;
6,Number.isFinite(n);
7,Number.isInteger(n);
8,Number.isSafeInteger(n);
9,Number.isNaN(n);
10,n.tofixed(key);
11,n.toString();
2025年06月29日
索引:
1,parseFLoat(n);
2,parseInt(n);
3,Number(n);
4,Number.MAX_VALUE;
5,Number.MIN_VALUE;
6,Number.isFinite(n);
7,Number.isInteger(n);
8,Number.isSafeInteger(n);
9,Number.isNaN(n);
10,n.tofixed(key);
11,n.toString();
2025年06月29日
开发痛点:传统Java项目30%代码在重复造轮子(IO流关闭/日期格式化/类型转换...)
2025年06月29日
1 、tofixed方法
toFixed() 方法可把 Number 四舍五入为指定小数位数的数字。例如将数据Num保留2位小数,则表示为:toFixed(Num);但是其四舍五入的规则与数学中的规则不同,使用的是银行家舍入规则,银行家舍入:所谓银行家舍入法,其实质是一种四舍六入五取偶(又称四舍六入五留双)法。具体规则如下:
2025年06月29日
Lambda 表达式是 Java 8 引入的一种简洁的语法,主要用于 简化匿名内部类 的写法,特别适用于 函数式接口(Functional Interface)。
Lambda 表达式的基本格式如下:
2025年06月29日
//万能的类型判断方法,可以判断所有对象的类型
const objectToString = Object.prototype.toString;
const toTypeString = (value) => objectToString.call(value);
//判断是否是Array
const isArray = Array.isArray;
//判断是否是Map
const isMap = (val) => toTypeString(val) === '[object Map]';
//判断是否是Set
const isSet = (val) => toTypeString(val) === '[object Set]';
//判断是否是Date
const isDate = (val) => val instanceof Date;
//判断是否是Function
const isFunction = (val) => typeof val === 'function';
//判断是否是String
const isString = (val) => typeof val === 'string';
//判断是否是Symbol
const isSymbol = (val) => typeof val === 'symbol';
//判断是否是非空对象
const isObject = (val) => val !== null && typeof val === 'object';
//判断是否是Promise
const isPromise = (val) => {
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
};
//判断是否是普通的Object对象
const isPlainObject = (val) => toTypeString(val) === '[object Object]';
//特别注意:
1.typeof 对象判断方法:
typeof null // "object";
typeof undefined //"undefined"
2.声明未赋值的变量的类型为undefined:
let abc //undefined
2025年06月29日
在编程中,遇到类型转换,好像会经常用到 parseInt 和 valueOf,当然这里只拿 Integer 类型进行陈述,其他类型也是雷同的;
2025年06月29日
SQL 注入分类
1. 数字型注入
当输入的参数为整型时,则有可能存在数字型注入漏洞。
假设存在一条 URL 为:
HTTP://www.aaa.com/test.php?id=1
可以对后台的 SQL 语句猜测为:
2025年06月29日
多年经验程序员总结的我们一般需要使用的sql语句,赶快收藏起来,方便以后使用。 以下是一些常用的SQL语句及其用法: