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
1 change: 1 addition & 0 deletions code/tuesday.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ <h1>Tuesday: Control Flow</h1>
<script type="text/javascript" src="tuesday.js"></script>
</body>
</html>
/
87 changes: 72 additions & 15 deletions code/tuesday.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,87 @@
var day = 'Monday';
console.log('the day is: ' + day);
var threeInputs = function(){

day = 'Tuesday';
console.log('the day is: ' + day);
var input = [];
for(var i = 3; i > 0; i--) {
input.push(prompt("give input"));
}

day = 'Thursday';
console.log('the day is: ' + day);
confirm(input + input.length);
};

day = 1;
console.log('the day is: ' + day);
// threeInputs();

var monday = 'monday';
var tuesday = 'tuesday';
var wednesday = 'wednesday';

var need15Char = function() {

var input = "";
do{
input = input + prompt("give input");
} while(input.length < 15);

confirm(input);
}

// need15Char();


var getTrue = function() {
var input = false;
do {
if(prompt("enter \"true\"") === "true"){
input = true;
}
} while(input === false);
}

//getTrue();

function isNaN_wut() {

var input = "blah";
confirm(input);
confirm(isNaN(input));

input = 42;
confirm(input);
confirm(isNaN(input));

input = "42";
confirm(input);
confirm(isNaN(input));
confirm(input);

}

isNaN_wut();


// var day = 'Monday';
// console.log('the day is: ' + day);

// day = 'Tuesday';
// console.log('the day is: ' + day);

// day = 'Thursday';
// console.log('the day is: ' + day);

// day = 1;
// console.log('the day is: ' + day);

// var monday = 'monday';
// var tuesday = 'tuesday';
// var wednesday = 'wednesday';
// console.log('the variable monday contains: ' + monday);
// console.log('the variable tuesday contains: ' + tuesday);
// console.log('the variable wednesday contains: ' + wednesday);

monday = tuesday;
tuesday = wednesday;
// monday = tuesday;
// tuesday = wednesday;
// console.log('the variable monday contains: ' + monday);
// console.log('the variable tuesday contains: ' + tuesday);
// console.log('the variable wednesday contains: ' + wednesday);

var number = 1;
var numberString = '1';
// var number = 1;
// var numberString = '1';
// console.log('the variable number contains: ' + number);
// console.log('the variable numberString contains: ' + numberString);

Expand Down
5 changes: 4 additions & 1 deletion notes/monday.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ Make a change
Make another change
Do something else
tra la la

How did I get here!!!
here's another change

more notes for a monday night!!!!
monday night

David's change!
another one!
1 change: 1 addition & 0 deletions notes/thursday-davidN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello!
35 changes: 35 additions & 0 deletions notes/thursday-nathans.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

Day 4

Git branch Thursday creates branch: Thursday
Git checkout Thursday switch to branch: Thursday

Git branch lists branches
***Combine all: git checkout –b Thursday***

create file Today: notes/Thursday-nathans.md

then;

git add notes/Thursday-nathans.md
git commit-m “add file for Thurdsday”

“3” == 3 true (not so strict comparison)
“3” === 3 false (strict comparison)

in JS, use === except in a few precious, few instances

Truthy & Falsy

True enough or false enough WTF!!!

= assigns a value
=== strict comparison
==, not so strict (don’t use)


DRY: Don’t Repeat Yourself (maxim in development)
If you are doing it 6 times, THAT’S WHY WE HAVE COMPUTERS

FOR LOOP:
We have a sequence of things that we can use an iterator for
7 changes: 7 additions & 0 deletions notes/tuesday.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Tuesday notes

Branches give you a way to work with different versions of the files
git branch tuesday (create branch)
* how to use vi



my edit ***
18 changes: 18 additions & 0 deletions notes/wednesday.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

Create and checkout a branch….
1. Git branch Wednesday
2. Git checkout Wednesday
OR
Git checkout –b Wednesday

Touch notes/Wednesday.md
Git add notes/Wednesday.md
Git commit –m “add Wednesday notes”

End of day:
Add and commit on Wednesday branch.
Checkout master
Git merge Wednesday

Scope (global or functional (within the/a function)?)
Arrays are JS way of making lists