Skip to content

Instantly share code, notes, and snippets.

@fwon
Created March 24, 2016 08:30
Show Gist options
  • Save fwon/e2432c098c46811cd0f2 to your computer and use it in GitHub Desktop.
Save fwon/e2432c098c46811cd0f2 to your computer and use it in GitHub Desktop.
简短代码实现方法
//创建一个n长的空格字符串
Array(n).join(' ')
//判断Object是否为空
Object.keys(obj) === 0
//判断是否为PlainObject(不为window,Node等)
function isObject(val) {
return Object == val.constructor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment