Last active
December 24, 2015 15:09
-
-
Save stevencombs/6818534 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
// 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