Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 0 additions & 144 deletions .gitignore

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5504
}
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ By the end of this assignment you will be able to:
- Demonstrate how to inspect an HTML element and view its box model
- Show an emulation of how a webpage looks on a mobile browser

(Prepare to demo these skills in class!)

## Your task

- Fork and clone this repository
- Type `npm install` to load up browser-sync (This is a nice tool that is already included in this repository for you! It will reload changes automatically for you! You don't have to use it if you don't want to, but it is provided for your convenience!)
- use `npm start` to initiate browser-sync (This loads up your internet browser and serves up your page)
- Open `index.html`
- Read carefully through index.html for directions on how to complete your assignment
- Debug the debug.js file as instructed.
- Your console will be free of any JS errors at the end!
Expand All @@ -28,10 +25,8 @@ If you get stuck...
- Check out this [W3Schools article about common JavaScript mistakes](http://www.w3schools.com/js/js_mistakes.asp)
- Always feel free to work with a partner!
- Ask for help via our Slack channel
- Review past notes on the [course website](https://gawdiseattle.gitbooks.io/wdi/content/)
- Go to the [Google Developers Website](https://developers.google.com/web/tools/chrome-devtools/javascript/) for more in depth instructions of the things the debugger and dev tools can do.

## Further Resources

- The [Google Developers Youtube Channel](https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw) has tons of resources about the Dev Tools (I like [this video](https://www.youtube.com/watch?v=nOEw9iiopwI) in particular as a guide to some dev tool shortcuts).
- Curious about [browsersync](https://www.browsersync.io/)?
61 changes: 41 additions & 20 deletions js/debug.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,65 @@
document.addEventListener('DOMContentLoaded', function(){
console.log("Let's learn how to debug.");

var x = 2;
var result = Math.power(x, x); //expects 2^2 equals 4
const x = 2;
const result = Math.pow(x, x); //expects 2^2 equals 4
console.log("Got", result, "Expected 4");

var y == 4;
var result2 = y + x; //expect 4 + 2 equals 6
const y = 4;
const result2 = y + x; //expect 4 + 2 equals 6
console.log("Got", result2, "Expected 6");

var z = { width: 5, height: 7};
console.log("z is ", z.getWidth(), "inches wide."); //expect "z is 5 inches wide"
const z = {
width: 5,
height: 7
};
console.log("z is ", z.width, "inches wide."); //expect "z is 5 inches wide"

const name = 'weston'
const string = `${name} is cool as heck`
console.log(string); // expect "weston is cool as heck"

var q = 100;
if(q > 50);{
const q = 100;
if(q > 50) {
console.log("q is a big number"); //this is what should print to the console
};
else{
} else {
console.log("q is less than 50 dawg")
};

var amount = 13;
console.log(var amount + 13); //should print out 26
let amount = 13;
console.log("Got", amount + 13, "expected 26"); //should print out 26

amount = Math.pow();
console.log("Got", amount, "expected 169") //should print 169, since 169 is 13

var num = "37";
if(num = "5"){
const num = "37";
if(num === "5"){
console.log("My num is", num); //This should not get printed since num is "37"
}

var jackson = "dope dude";
if{typeof jackson === "string"}{
console.log("jackson is a", jackson);//should print "jackson is a dope dude", which is true
const henry = "dope dude";
if(typeof henry === "string") {
console.log("henry is a", henry);//should print "henry is a dope dude", which is true
}

var actorOfTheCentury = "Nicolas Cage";
console.log(actorofThecentury, "is a God of excellence and beauty"); //should print "Nicolas Cage is a God of excellence and beauty" which is also true.
const actorOfTheCentury = "Nicolas Cage";
console.log(actorOfTheCentury, "is a God of excellence and beauty"); //should print "Nicolas Cage is a God of excellence and beauty" which is also true.

var bestMovieEver = "American Treasure';
const bestMovieEver = "American Treasure"
console.log(bestMovieEver);//should print "American Treasure"

// this should log the numbers from 0 to 5
for (let i = 0; i < 6; i++) {
console.log([i])
}


const array = ['hi', 'hello', 'sup']

// this should log the words from the array
for (let str in array) {
console.log(str);
}

document.getElementById("finish").innerText = "YOU'RE ALL DONE!!";
});
15 changes: 0 additions & 15 deletions package.json

This file was deleted.