Created
March 24, 2016 08:30
-
-
Save fwon/e2432c098c46811cd0f2 to your computer and use it in GitHub Desktop.
简短代码实现方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//创建一个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