Created
January 6, 2017 16:05
-
-
Save duncan60/709957ce58e3a10adb376213071151b6 to your computer and use it in GitHub Desktop.
This file contains 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
#判断是否是Array | |
function isArray(data) { | |
return Array.isArray ? Array.isArray(data) : Object.prototype.toString.call(data) === '[object Array]'; | |
} | |
#判断是否是 empty object {} | |
var isEmpty = function ua(data) { | |
if (Object.keys) | |
return Object.keys(data).length === 0; | |
for (var wa in data) | |
if (data.hasOwnProperty(wa)) | |
return false; | |
return true; | |
}; | |
#reference url: http://tech.colla.me/en/show/learn_from_facebook_pixel_js_code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment