Skip to content

Instantly share code, notes, and snippets.

@stevencombs stevencombs/IDPlease.js
Last active Dec 24, 2015

Embed
What would you like to do?
// 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
You can’t perform that action at this time.