-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
var nameOfVariable = "Something" | ||
//or | ||
//let nameOfVariable = "Something" | ||
|
||
//coonst - a read only statement that makes the variable stay | ||
|
||
console.log(nameOfVariable.toUpperCase(), nameOfVariable ); | ||
//You don't have to use var again once it is assigned | ||
|
||
nameOfVariable = "something else"; | ||
console.log(nameOfVariable); | ||
|
||
nameOfVariable = 30; | ||
console.log(nameOfVariable + "Something"); | ||
// Most other programming languages would freak out if you did this ^ | ||
|
||
let num1 = 10; | ||
let num2 = 20; | ||
let num3 = 30; | ||
|
||
console.log(num1 / num2); | ||
|
||
let myValue = (num1 <= num2); | ||
console.log(myValue); | ||
|
||
let greeting = "Hello" | ||
let first = "Meira"; | ||
let last ="Tompkins"; | ||
|
||
console.log(greeting + ", " + first + ":" + "\n\n\n\n") | ||
|
||
// \n or <br> | ||
|
||
console.log(typeof greeting); | ||
//type of will output what type of thing the text is - it can be string, number, boolean, object | ||
|
||
let performers = ["J-LO", "Shakira"]; | ||
|
||
console.log(performers.length); | ||
//arrays are objects too so they have methods | ||
|
||
performers.push("Demi Lovato"); | ||
performers.forEach(function(performer){ | ||
if(performer == "Demi Lovato"){ | ||
console.log("You're cancelled, " + performer) | ||
}else{ | ||
console.log("Hello, " + performer); | ||
} | ||
}); | ||
|
||
|