Featured

Why learn to code?

via Lisa Charlotte Rost, “How I Feel When I Learn To Code

I’m not sure if you’ve actually asked yourself this question or tried to describe an answer to this question. So I thought we’d start with this given we’re in a classroom with students that will be taking their first JavaScript course as well as those taking their second.

If you’ve never thought about it, consider looking at the r/learnprogramming subreddit. This is one of many communities out there where people are starting out with a number of different programming languages looking for support in a variety of ways – getting started, finding a project to work on, showcasing tools you use, getting feedback on work, and finding the answer to an-infinite-number-of-problems-encountered-when-trying-to-learn-to-program.

Look through the subreddit’s wiki on “common concerns and fears” and “questions about learning.” Choose a couple topics from these to talk to a partner about. Take notes on their answers as well as yours. Summarize your thoughts, concerns, and questions in your first blog post.

Okay next up..Functions! :(

Describe the difference between declaring a function and calling a function. Give an example in a code snippet using Enlighter.

Functions let us wrap code in reusable packages. Declaring a function is basically naming the function and then consoling the function to do what you put in the parenthesis.

This is how you declare a function:

function doSomething(){ 
console.log("Hello World");
}

Calling a function is a bit different the function you have declared now has to be told what to do.

This is how you call a function:

function doSomething(){ 
console.log("Go clean up!");
console.log("Go to sleep!");
}
//this is what calling it would look like
doSomething();
Go clean up!
Go to sleep!

These are the exercises for this week:

function-examples.html / functions-examples.js

scope-example.html / scope-example.js

These are the problem sets:

randomcolor.html / randomcolor.js

game.html / game.js

stairs.html / stairs.js

mountains.html /mountains/js (Not quite finished!)

Is it really just week two?

I feel like I’ve been doing javascript forever because I’ve been learning so much. Am I understanding everything? Ha! No, I am not fully understanding but I tend to go back to the code along for assistance.

How can you use “falsey-ness” to determine if a string value can be coerced to a number? Why does this work? What is “type coercion” anyway?

  • You can use “falsey-ness” to determine if a string value can be coerced to a number by (I’ll keep you updated on this answer).
  • Type coercion is when you change a type of value to a different type of value. For example changing a Number( ) to a “string” or vice versa.

What do you need to do to convert a for loop to a while loop?

  • In order to change a for loop to a while loop, you wouldn’t need to know the number of repetitions like how you NEED to know it for, (for loops). For example, while (condition) { //run some code } vs. for (int; condition; step {//run some code}
  • This is an example of a for loops below:
for(let i = 300; i <= 333; i++) {
    if(i % 2 !==0){
        console.log(i);
    }
}

This is an example of a while loop below:

let num = 1;
while(num<= 20) {
    if(num % 4 === 0){
        console.log(num);
    }
    num++;
}

This week contained a lot of information that I can’t memorize just from looking at it once, I have to keep looking at my notes to know where to put what. I guess switch statements were not so bad but trying to understand for loops and while loops have me feeling like a granny. Here are the exercises:

bouncer.html / bouncer.js

number-guess / number-guess.js

while-loops / while-loops.js

annoy -o- matic.html / annoy -o- matic.js

for-loops.html / for-loops.js

These are the problem sets:

feeling.html / feeling.js

running.html / running.js

weather.html / weather.js

guess.html / guess.js

stairs.html / stairs.js

mountain.html / mountain.js

Week 3 – Blog Post

Describe the difference between declaring a function and calling a function. Give an example in a code snippet using Enlighter. Have you example use an argument.

Declaring a function tells the computer that this block of code should be executed whenever this function name is called. Its basically labeling a section of your code, usually set within curly brackets. Calling a function tells the computer, “Hey execute that code I labeled.”

Example:

//Below is an example of a function declaration
function(){
// function code goes here
}
//Below is an example of calling a function.
function();

Aaaaaaaaaaaaaaaaaaaaaaaand here’s this weeks work.

Week 2 – Blog Post

Blog Questions:

How can you use “falsey-ness” to determine if a string value can be coerced to a number? Why does this work? What is “type coercion” anyway?

Falsey-ness can be used to test if a value is true or false. This can be done in the developer console. Coercion is the process of converting the type of one value to another.

!potato(potahto)
// test the falsey-ness of a number or string

What do you need to do to convert a for loop to a while loop?

To convert a for loop to a while loop you use the same principals but you have to restructure the arguments.

for ( ForInit ; Expression ; ForUpdate ) Statement
// this is basic for syntax
// now to convert to a while statement we reorder
ForInit;
while (Expression) {
  Statement;
  ForUpdate;
}
// both of these loops work the same way

As for the week work, heres the directory drop. I have to work on organizing files, I know.

JS Basics Functions + Prblem set !!

Hey guys,

You can find the directory for the js basic functions here.
The problem set here

declaring and calling a function are to different things when you declare a function you are basically creating a set of instructions that have “no real purpose”… when you call the function using a function call you are executing the lines of code( instructions), within the function.

function doSomething(num){
     // function declaration
     // put instructions for task
     return num + num;
}

//function call
doSomething(8);
// function call exetuces set of instruction within function
// value is returned.

[WEEK #3] – 10 JavaScript Basics – Functions + Problem Sets + Blog Question


Hey guys. This week was pretty light on me because I know what functions are and I have worked with these before in different languages. The only thing that stumped me up was the random-color problem set. I had trouble with how to properly generate a random number between 0 and 255 that also included both the numbers. I believe I did it correctly but I am not sure. Overall this was a light week (work wise).

Tutorials


Problem Sets


Blog Question


Describe the difference between declaring a function and calling a function. Give an example in a code snippet using Enlighter. Have you example use an argument.

Functions let us wrap code into reusable packages. They are one of the building blocks of JavaScript. When declaring a function, you define a block of code and give it a name. If you just have a declaration inside of the js file, the JavaScript file will not run anything. Essentially you are just registering the function. When calling a function you are basically giving an order to the function, that is telling it to execute. To call a function you have to write the function name with ( ).

//Declaring a function
function randomTest() {
    console.log("Hey! I am declaring a function");
}

//Calling a function
randomTest();
randomTest();
randomTest();

dev1 – JS Basics, Control Flow

DIRECTORY


[WEEK #2] – 09 JavaScript Basics – Control Flow + Problem Sets + Blog Question


Hey guys. This week was pretty fun. I am actually enjoying this programming language more than others that I have learned. This week was not that challenging but one of the questions in the problem set made me use GooGle. I had to look up some new tools and resources for help.

Tutorials


Problem Sets


Blog Question


How can you use “falsey-ness” to determine if a string value can be coerced to a number? Why does this work? What is “type coercion” anyway?

You can use falsey-ness to test if a value is true or not in the developer console. Type coercion is to coerce a number to a string and a string to a number. In other words its one primitive type to another.

!Number(str) //to test if that's a number

Falsy Values
false
""
null
undefied
NaN
0

What do you need to do to convert a for loop to a while loop?

First, a for loop has a initializer, condition, and increment-er. A while loop only has a condition. You have initialize the while loop out side of the loop and increment it inside of the while loop. You can declare it before setting the condition.

while (someCondition){
    runs some code
}

for (init; condition; step){
    runs code
}

Week 2- Off To A Great Start

Another week done another batch of work done here’s everything I have for this week

Tutorials

Problem set

Blog questions

*Coming soon*

css.php