Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
met18001 committed Feb 3, 2020
1 parent 20619b7 commit fb4d142
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
3 changes: 2 additions & 1 deletion week-3/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<title>Week 3 in Scripting for the Web</title>
</head>
<body>

<h1>Week 3</h1>
<script src="js/main.js"></script>
</body>
</html>
51 changes: 51 additions & 0 deletions week-3/js/main.js
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);
}
});


0 comments on commit fb4d142

Please sign in to comment.