This file contains hidden or 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
Show hidden characters
{ | |
// If plugin has trouble finding Node.js, replace this string with path | |
// to your `node` bin | |
"node-path" : ":/usr/local/bin", | |
// Full list of supported options and acceptable values can be found here: | |
// https://github.com/csscomb/csscomb.js/blob/master/doc/options.md | |
"config": { | |
// Whether to add a semicolon after the last value/mixin. |
This file contains hidden or 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
var CarLot = (function () { | |
var inventory = []; | |
var fillInventory = function(data) { | |
data.cars.forEach(function(element){ | |
inventory.push(element) | |
}); | |
} | |
return { | |
getInventory: function () { | |
return inventory |
This file contains hidden or 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
// ************************************************* | |
// ** Remember to npm install grunt-contrib-sass` ** | |
// ************************************************* | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
browserify: { | |
'../dist/app.js': ['../js/quiz.js'] |
This file contains hidden or 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
console.log("First line in JS file"); | |
console.log(Date.now()); //time stamp when page loads | |
function executeThisIfXHRFails(xhrEvent) { | |
console.log("An error occured while transferring the data"); | |
} | |
function executeThisCodeAfterFileIsLoaded() { | |
console.log("this", this ); | |
console.log("execute this code after file is loaded"); |
This file contains hidden or 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
"use strict" | |
function populatePage (inventory) { | |
// Grab the div we want to apppend the cards to | |
let cards = document.getElementById("inventory-cards"); | |
// Loop over the inventory and populate the page | |
inventory.forEach(function(car, index) { | |
let carCard = buildCard(car, index); | |
let cardDiv = document.createElement("div"); //<---Here's the key to adding the cards with the click event intact |
This file contains hidden or 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
"use strict"; | |
function func1() { | |
if (true) { | |
let tmp = 123; | |
} | |
console.log("func1 tmp", tmp); // ReferenceError: tmp is not defined | |
} | |
func1(); |
This file contains hidden or 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
<form action="form.html" method="POST"> | |
<fieldset> | |
<legend>Tell us about yourself</legend> | |
<label for="first-name">Enter your first name</label> | |
<input type="text" id="first-name" placeholder="Enter your first name"autofocus> | |
<br/> | |
<label for="last-name">Enter your last name</label> | |
<input type="text" id="last-name"> | |
<br/> | |
<label for="email-address">Enter your email address</label> |
This file contains hidden or 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
<!DOCTYPE html> <!-- tells browser what version--> | |
<html> | |
<head> <!-- header info, styles, meta etc--> | |
<meta charset="UTF-8"> <!-- define alphabet--> | |
<meta name="author" content="Joe Shepherd"> <!-- Define Page author --> | |
<title>Hi there</title> <!--tab title--> | |
<link rel="stylesheet" type="text/css" href="styles.css"> | |
</head> | |
<body><!-- displays the page--> | |
<nav> |
This file contains hidden or 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
//****************************************************************************************************************** | |
// This will break if you run it as is. You have to commment out all of the sections except the one you want to run. | |
//****************************************************************************************************************** | |
/* | |
Example one: call site and call stack | |
*/ |
This file contains hidden or 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
All the values in these objects happen to be strings ("Carly Rae Jepsen", "Livin on a Prayer", etc), but values can be any data type: | |
String, array, boolean, null, undefined, even other objects. |
OlderNewer