Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created August 7, 2015 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/9646e37b7e1b79a60cdc to your computer and use it in GitHub Desktop.
Save chuck0523/9646e37b7e1b79a60cdc to your computer and use it in GitHub Desktop.
var obj = {
mon : 0,
tue : 1,
wed : 2,
thu : undefined,
time : {
morning : "5-11",
night : "19-22"
}
}
var name;
for (name in obj) {
if (typeof obj[name] !== 'function') {
console.log(name + ':' + obj[name]);
// mon : 0
// tue : 1
// wed : 2
// thu : undefined
// time : [object Object] となる
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment