LGTM & code review
LGTM & code review
LGTM is an acronym meaning
looks good to me
, frequently used when reviewing documents.
https://github.com/lodash/lodash/pull/4756
https://github.com/learning-js-by-reading-source-codes/lodash/blob/master/.internal/getTag.js
js data types checker
Object.prototype.toString.call();
function getTag(value) {
if (value == null) {
return value === undefined ? '[object Undefined]' : '[object Null]'
}
return toString.call(value)
}
const value = 1n;
getTag(value) === '[object BigInt]'
// true
getTag(value)
// "[object BigInt]"
toString.call(value)
// "[object BigInt]"
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/12873481.html
未经授权禁止转载,违者必究!