javascript day 0 : basic programming (newbie)

1. write name : “ridha” or “danjanny”

2. finding the length (how long my name?)

“ridhadanjanny”.length

3. basic math

4. error : doesn’t compute!

computer only speak certain language.

5. // is a comment and is ignored by the computer

what am i learning ?

  • javascript used for make websites repond to user interaction build apps and mobiles.
  • create web interactive

DATA TYPES

Data types I & II : Number & Strings

a. numbers are quantities

b. strings

c. boolean

cheat sheet :

string => “string of text”.length

string= “word”

console.log (printing out)

will take whatever is inside the parentheses and log it to the console below your code.

console.log(“hello stranger!”);

console.log(myVariable);

comparisons

list of comparison operators :

<= less than or equal to

>=greater than or equal to

=== equal to

!== not equal to

example :

capture_codecademy_comparisons

 

 

Decisions

comparison plus booleans to decide whether a block of code should run.

if (true conditions)

{

console.log(“you are good at math!”);

}

console.log(false statement)

Robot two options :

if(condition is true)

{

// do this code

}

else // “otherwise”

 

 

 

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s