Last active
April 30, 2025 19:01
-
-
Save MtgGamer19/b63ab15cc54fd0ffd822c197c8c67d0d to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1>JS Review</h1> | |
<p>JS output:</p> | |
<p id="output"></p> | |
<script type="text/javascript" src="script.js"></script> | |
</body> | |
</html> |
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
let name="Ryan"; | |
let seahawksScore=0; | |
console.log(seahawksScore); | |
console.log(seahawksScore<21); | |
seahawksScore++; | |
seahawksScore+=6; | |
seahawksScore--; | |
if (seahawksScore<21){ | |
console.log("seahawks Score!"); | |
} | |
else if(seahawksScore === 21){ | |
console.log("seahawks score 21"); | |
} | |
else{ | |
console.log("seahawks Score is greater than 21"); | |
} | |
console.log(seahawksScore); | |
let seahawksTeam=["Sam Darnold", "Cooper Kupp", "Drew Lock"]; | |
console.log(seahawksTeam[0]); | |
console.log(seahawksTeam[1]); | |
console.log(seahawksTeam[2]); | |
let fortyninersTeam=["Brock Purdy", "Christian Mcaffery", "Brandon Aiyuk", "George Kittle"]; | |
console.log(fortyninersTeam[0]); | |
console.log(fortyninersTeam[1]); | |
console.log(fortyninersTeam[2]); | |
console.log(fortyninersTeam[3]); | |
for (let i=1; i<5; i++){ | |
console.log(i); | |
} | |
for (let i=0; i<3; i++){ | |
console.log(seahawksTeam[i]); | |
} |
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
for(let i=1; i>5; i++){ | |
console.log(i); | |
} | |
let i=1; | |
while (i<5) { | |
console.log(i+" hello"); | |
i++; | |
} | |
console.log(Math.random()); | |
console.log( Math.floor( Math.random()*10 ) ); | |
console.log( Math.floor( Math.random()*10 ) ); | |
console.log( Math.floor( Math.random()*10 ) ); | |
while (false) { | |
console.log("test 1"); | |
} | |
do { | |
console.log("test 2"); | |
} while(false) | |
let randomNum = Math.floor( Math.random()*7 ); | |
do { | |
console.log(randomNum); | |
randomNum = Math.floor( Math.random()*7 ); | |
} while (randomNum != 6) | |
console.log("We finally got " + randomNum + "!!!!"); | |
let colors = ['red', 'black', 'green', 'blue']; | |
for (let color of colors){ | |
console.log(color); | |
} |
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
for(let i=1; i<5; i++){ | |
console.log(i); | |
} | |
let jerseyNumber=7; | |
while(jerseyNumber>0){ | |
console.log(jerseyNumber); | |
jerseyNumber--; | |
} | |
let seahawks=["Geno Smith", "Tyler Lockett", "DK Metcalf"]; | |
for(let name of seahawks){ | |
console.log(name); | |
} | |
function sayHello() { | |
console.log("hey there"); | |
} | |
sayHello(); | |
sayHello(); | |
sayHello(); | |
function sayBye() { | |
console.log("addios"); | |
} | |
sayBye(); | |
function greetUser(username) { | |
console.log("Hello " + username); | |
} | |
greetUser("drewlock100"); | |
greetUser("sammy66"); | |
function kickoff(player) { | |
console.log(player + " is kicking off"); | |
} | |
kickoff("jon ryan"); | |
kickoff("travis kelce"); | |
function greetUser(firstName, lastName) { | |
console.log("Hello " + firstName + " " + lastName); | |
} | |
greetUser("Farhad", "Ahmed"); | |
greetUser("Farhad", "Ahmed"); | |
function passBall(player1, player2) { | |
console.log(player1 + " passing to " + player2); | |
} | |
passBall("Smith", "Lockett"); | |
passBall("Darnold", "Kupp"); | |
let currentScore = 18; | |
let x = 0; | |
function touchDown() { | |
x =100; | |
// currentScore = currentScore + 6; | |
currentScore += 6; | |
return currentScore; | |
} | |
let newScore = touchDown(); | |
console.log(newScore); | |
console.log(currentScore); | |
touchDown(); | |
console.log(currentScore); | |
console.log(x); | |
function moveBall(currentYardline, yardsGained){ | |
return currentYardline + yardsGained; | |
} | |
let newYardline = moveBall(25, 10); | |
console.log(newYardline); | |
newYardline = moveBall(35, 1); | |
console.log(newYardline); | |
const UPDATE_SCORE = (currentScore) => { | |
return currentScore + 6; | |
} | |
console.log(UPDATE_SCORE(14)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment