This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Variables-our friends in the age of repetition | |
| Variables are placeholders which allow programs to easily recall | |
| information or actions, alter them, and implement complex operations | |
| in a clear concise manner. They can be thought of as containers for | |
| holding values of any data type including numbers, strings, booleans, | |
| and even functions or objects. | |
| */ | |
| /*declaring a variable called num1 with "var" keyword | |
| this simply creates a place in memory which can then be assigned to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Strings are our way of storing characters and they are ALWAYS | |
| // contained in either 'single' or "double" quotes, but never a | |
| // 'combination" of the two. | |
| // String manipulation: | |
| // Arithemetic operation on strings | |
| // | |
| var name = "James"; | |
| var greeting = "Hello" + " " + name; | |
| console.log(greeting); | |
| // above we are adding "Hello" with a space and the variable name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Operators-the verbs of programming | |
| // 1_Assignment | |
| // The assignment operator "=" is used to "assign" values to | |
| // variables often it is helpful to replace the "=" with the term | |
| // "gets" to better understand how variables and values function. | |
| // variable declared | |
| var x; | |
| console.log(x); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Datatypes come in both simple and complex varieties. | |
| Below is a short list of the variety of datatypes one can use. | |
| */ | |
| var log =console.log; | |
| //1_Numbers include all numeric values | |
| var number1 = 1;//whole number | |
| var number2 = 2.08765;//decimal | |
| var number3 = number1/number2; | |
| console.log(number1, number2, number3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Control Flow:if, else if, else | |
| //making big decisions and getting sh*t done | |
| // these statements are used to control the flow of information and action | |
| // and allow programs to make decisions based on such informationa and action | |
| // if statements | |
| "use strict"; | |
| console.log("beginning"); | |
| var timeInHrs = 9; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Loops: while, for, for in. | |
| // Making your way through the world today. | |
| // while loops address a condition and execute the code within {} as | |
| // long as that statement holds true | |
| "use strict"; | |
| var x = 0; | |
| while (x === 0) { | |
| console.log("we're ready for something"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Functions: programs within programs. | |
| //a dream within a dream | |
| var fullName = function(first, middle, last){ | |
| var person = { | |
| FirstName: first, | |
| MiddleName: middle, | |
| Last: last | |
| } | |
| var newName = first + " " + middle + " " +last; | |
| console.log(newName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Loops: while, for, for in. | |
| // Making your way through the world today. | |
| // while loops address a condition and execute the code within {} as | |
| // long as that statement holds true | |
| "use strict"; | |
| var x = 0; | |
| while (x === 0) {} | |
| //console.log("we're ready for something"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Functions: programs within programs. | |
| //a dream within a dream | |
| //two phases of functions are declaration and invocation(or calling) | |
| // declaration (anonymous function being declared as variable) | |
| // | |
| var fullName = function(first, middle, last){ | |
| var person = { | |
| FirstName: first, | |
| MiddleName: middle, | |
| Last: last |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Variables-our friends in the age of repetition | |
| Variables are placeholders which allow programs to easily recall | |
| information or actions, alter them, and implement complex operations | |
| in a clear concise manner. They can be thought of as containers for | |
| holding values of any data type including numbers, strings, booleans, | |
| and even functions or objects. | |
| */ | |
| /*declaring a variable called num1 with "var" keyword | |
| this simply creates a place in memory which can then be assigned to |
OlderNewer