Skip to content

Instantly share code, notes, and snippets.

@stevencombs
Last active December 24, 2015 15:09
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 stevencombs/6818534 to your computer and use it in GitHub Desktop.
Save stevencombs/6818534 to your computer and use it in GitHub Desktop.
// Javascript Getting Started with Programming
// A Codecademy Javascript (I.D. Please and Know Thyself) assignments
// Dr. Steven B. Combs, coding novice
var anObj = { job: "I'm an object!" };
var aNumber = 42;
var aString = "I'm a string!";
// typeof identifies the type from an object, number variable or string variable
console.log(typeof anObj); // will print "object"
console.log(typeof aNumber); // will print "number"
console.log(typeof aString); // will print "string"
// Know Theyself
var myObj = {
name: "Steven",
};
console.log( myObj.hasOwnProperty('name') ); // will print true
console.log( myObj.hasOwnProperty('nickname') ); // will print false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment