Today, my classes go over arrays and operators. In today's first lesson, I combined loops and arrays like so:
var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
for (var i = 0; i < languages.length; i++) {
console.log(languages[i]);
}
The code above prints out the following:
HTML
CSS
JavaScript
Python
Ruby
The code stops logging when i is less than 5, which means it stops logging when it gets to 4, which is the 5th item in the array, but represented by the number 4, because the array begins at 0. You can also have arrays inside of arrays, like so:
var fruits = [["red apples", "green apples"], "Oranges"];
This was an array and a for loop I worked on:
var friends = ["Nick", "Israel", "Ramon", "Bob"];
console.log(friends);
console.log(friends.length);
for( var i=0; i < friends.length; i+=1) {
console.log(friends[i]);
}
Next, we went over objects, which are a type of value found in javascript. Objects have key value pairs, or properties. Objects are collections of information (keys and values) between curly braces, like so:
var myObject = {
key: value,
key: value,
key: value
};
Here's another:
var me = {
name: "John",
age: 27
}
That one makes more sense to me. This code below:
var me = {
first_name: "Jim",
last_name: "Hoskins",
"Employee Number": 1
}
console.log(me.first_name);
console.log(me.last_name);
console.log(me["Employee Number"])
Would output:
Jim
Hoskins
1
We can also call the object value like so:
console.log(me["last_name"]);
Which would output:
Hoskins
This:
console["log"](me);
Will output:
Object {first_name: "Jim", last_name: "Hoskins", Employee Number: 1}
The video said that the entire language (javascript) is basically built off of the object idea. I went over functions after objects and arrays. There's two more javascript courses on Treehouse that I would like to take, one is called Javascript Basics and the other is called Javascript Foundations. They're extremely similar, and I think that's great because it allows me to hit the same concepts over and over again until I'm very familiar with them. I completed the Introduction to Computer Programming Course today, and tomorrow, I'll continue with those two javascript courses, while also continuing my work on the prior Codecademy course.
var languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"];
for (var i = 0; i < languages.length; i++) {
console.log(languages[i]);
}
The code above prints out the following:
HTML
CSS
JavaScript
Python
Ruby
The code stops logging when i is less than 5, which means it stops logging when it gets to 4, which is the 5th item in the array, but represented by the number 4, because the array begins at 0. You can also have arrays inside of arrays, like so:
var fruits = [["red apples", "green apples"], "Oranges"];
This was an array and a for loop I worked on:
var friends = ["Nick", "Israel", "Ramon", "Bob"];
console.log(friends);
console.log(friends.length);
for( var i=0; i < friends.length; i+=1) {
console.log(friends[i]);
}
Next, we went over objects, which are a type of value found in javascript. Objects have key value pairs, or properties. Objects are collections of information (keys and values) between curly braces, like so:
var myObject = {
key: value,
key: value,
key: value
};
Here's another:
var me = {
name: "John",
age: 27
}
That one makes more sense to me. This code below:
var me = {
first_name: "Jim",
last_name: "Hoskins",
"Employee Number": 1
}
console.log(me.first_name);
console.log(me.last_name);
console.log(me["Employee Number"])
Would output:
Jim
Hoskins
1
We can also call the object value like so:
console.log(me["last_name"]);
Which would output:
Hoskins
This:
console["log"](me);
Will output:
Object {first_name: "Jim", last_name: "Hoskins", Employee Number: 1}
The video said that the entire language (javascript) is basically built off of the object idea. I went over functions after objects and arrays. There's two more javascript courses on Treehouse that I would like to take, one is called Javascript Basics and the other is called Javascript Foundations. They're extremely similar, and I think that's great because it allows me to hit the same concepts over and over again until I'm very familiar with them. I completed the Introduction to Computer Programming Course today, and tomorrow, I'll continue with those two javascript courses, while also continuing my work on the prior Codecademy course.
SUMMARY OF CODING SKILLS
Total Treehouse Points: 4,448
Treehouse Points by Subject Matter (Miscellaneous not included):
HTML: 663
CSS: 1,599
Design: 1,193
Development Tools: 747
Javascript: 213
Treehouse Ranking (%): "You have more total points than 89% of all students."
Treehouse Badge(s) Earned Today:
Objects and Arrays (Introduction to Programming)
Functions (Introduction to Programming)
Treehouse Courses Completed:
How to Make a Website
HTML
CSS Foundations
CSS Layout Techniques
Functions (Introduction to Programming)
Treehouse Courses Completed:
How to Make a Website
HTML
CSS Foundations
CSS Layout Techniques
Aesthetic Foundations
Design Foundations
Adobe Photoshop Foundations
Adobe Illustrator Foundations (66% complete, switched focus from web design to web dev)
Git Basics
Introduction to Programming
Codecademy (& other) Courses Completed:
HTML and CSS (Codecademy)
Design Foundations
Adobe Photoshop Foundations
Adobe Illustrator Foundations (66% complete, switched focus from web design to web dev)
Git Basics
Introduction to Programming
Codecademy (& other) Courses Completed:
HTML and CSS (Codecademy)
Books Read or in Progress:
Completed: "Head First HTML and CSS," by E. Robson & E. Freeman (37 pg preface and 710 pgs of actual content (as in, I'm not including the book's index))
My Progress on The Odin Project:
1. Introduction to Web Development 100% Complete
2. Web Development 101 29% Complete
3. Ruby Programming 0% Complete
4. Ruby on Rails 0% Complete
5. HTML5 and CSS3 0% Complete
6. Javascript and JQuery 0% Complete
7. Getting Hired as a Web Developer 0% Complete
Hours Spent Coding Today: 3
Total Hours Coding: 332.5
No comments:
Post a Comment