xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

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 发布文章使用:只允许注册用户才可以访问!


posted @ 2020-05-12 00:36  xgqfrms  阅读(390)  评论(5编辑  收藏  举报