Wednesday, July 1st
vim
... because what?nano
? It is easier and user-friendly.Dylan's Fix for using Chrome in Terminal
~/.bash_profile
filealias chrome="open -a \"Google Chrome\""
Setting Git to use Nano
git config --global core.editor "vim"
export GIT_EDITOR=nano
Nano Usage
nano file_to_open
ctrl-x
: ExitArray Methods/Attributes
For-In vs For Loops
var dogs = ["Belgium Manlinois",
"mutt",
"puggle",
"french poodle",
"Better than cat",
"newfie"];
var index; // undefined
// FOR-IN/FOREACH
for (index in dogs) {
console.log("my index is..." + index);
console.log(dogs[index]);
//console.log(dogs[0]);
}
// FOR
for (var breed = 0; breed < dogs.length; breed++) {
console.log(dogs[breed]);
}
For-in vs For Loops (pt2)
var students = ["Lichard", "Omily", "Kathew", "Cecelious"];
var student;
// FOR-IN or FOREACH
for (student in students) {
if (student == 0) {
console.log("This loop scope has started...");
console.log("Index:" + student);
console.log("Value: " + students[student]);
console.log("This loop scope has ended..");
}
}
console.log(student);
// FOR loop
for (var inc = 0; inc < students.length; inc++) {
console.log(students[inc]);
}
This afternoon we want to build upon the foundation of loops. We're going to draw them out and then write them! On your own, you will need to work on the following:
incrementing
(looping) through an Array in your own way. This should make sense to you.pop()
and push()
items from an array.shift()
and unshift()
items from an array.my_favourites.js
file in this directory.for
and a for-in/foreach
loop inside of this file.console.log()
each item.