Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 264fecd

Browse files
committed
upload homework week 1 js
1 parent fa3f2e2 commit 264fecd

12 files changed

+86
-0
lines changed

week4/10program.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var program = [23, "this is a string", 13, "yellow",];
2+
console.log(program);
3+
console.log(Infinity + Infinity);
4+
var compare = 6/0 === 10/0;
5+
console.log(compare);

week4/1hworldlanguages.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var myHelloWorld = ["Hello, World!", "Bonjour, le monde!", "Hej, världen!"];
2+
console.log(myHelloWorld);

week4/2Imawesome.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
console.log('I'm awesome' );
2+
//solution below:
3+
console.log('I\'m awesome' );

week4/3variablex.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var x;
2+
console.log("the value of my variable x will be: thereIsNoValue.");
3+
console.log(x);
4+
var x = 10;
5+
console.log("the value of my variable x will be: theNumber10.");
6+
console.log(x);

week4/4variabley.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var y = ["I am a string"];
2+
console.log("I think this string is a string");
3+
console.log(y);
4+
var y = ["I am a new string"];
5+
console.log("I think this new string is a new string");
6+
console.log(y);

week4/5roundingnumber.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var z = 7.25;
2+
console.log(z);
3+
var a = Math.round(z);
4+
console.log(a);
5+
var result = Math.max(z,a);
6+
console.log(result);

week4/6arrays.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var myArrays = [];
2+
console.log("this array is empty");
3+
var myAnimals = ["monkeys, dogs, cats, chickens"];
4+
console.log(myAnimals);
5+
myAnimals.push("baby pig");
6+
console.log(myAnimals);
7+

week4/7morestrings.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
let myString = ["this is a test".];
2+
console.log(myString);
3+
var stringLength = myString.length;
4+
console.log(stringLength);

week4/8sametype.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var a = 1;
2+
var b = ["my string"];
3+
var c;
4+
var d = null;
5+
6+
console.log("The value of my variable a is:" + a);
7+
console.log("The value of my variable b is:" + b);
8+
console.log("The value of my variable c is:" + c);
9+
console.log("The value of my variable d is:" + d);
10+
11+
console.log("The type of variable a is a number");
12+
console.log("The type of variable a is a string");
13+
console.log("The type of variable a is undefined");
14+
console.log("The type of variable a is null");
15+
var type_a = typeof 1;
16+
var type_b = typeof "my string";
17+
var type_c = typeof x;
18+
var type_d = typeof null;
19+
20+
if( type_a == type_b | type_c | type_d)
21+
{console.log('SAME TYPE');}
22+
else
23+
{console.log('DIFFERENT TYPE');}
24+

week4/9xequals7.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var x = 7;
2+
x = x % 3;
3+
4+
5+
console.log(7 % 3);
6+
7+
var y = (7 % 3);
8+
console.log(y);
9+
10+
console.log(x);
11+
12+

week4/dummy.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var name = prompt("hello world");
2+

week4/dummyhtml.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<script src ="10program.js"></script>
5+
</head>
6+
<body>
7+
hello world
8+
</body>
9+
</html>

0 commit comments

Comments
 (0)