Skip to content

Instantly share code, notes, and snippets.

@cloverich
Last active July 5, 2016 16:07
Show Gist options
  • Save cloverich/6f9d1149c02648bc06563a53e05f6514 to your computer and use it in GitHub Desktop.
Save cloverich/6f9d1149c02648bc06563a53e05f6514 to your computer and use it in GitHub Desktop.
// console.log can be used to print information to the screen
console.log("Hello, World"); // prints "Hello, World"
// Create an object `foodItem` to hold some information
var foodItem = {
fat: 25,
carbs: 82
}
// fat and carbs are now stored insode of foodItem
console.log(fat); // prints undefined
console.log(foodItem.fat); // prints 25
var isGoodForYou = (foodItem.fat < 20 && foodItem.carbs < 50) ? true : false;
var isGoodForYou2 = foodItem.fat < 20 && foodItem.carbs < 50;
console.log(isGoodForYou2 === isGoodForYou); // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment