Skip to content

Commit 05f3fca

Browse files
.
1 parent 26c25e0 commit 05f3fca

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

basics/Operators.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
let x;
2+
3+
// 1. Arithmetic
4+
5+
x = 5 + 5; // addition - 10
6+
7+
x = 5 - 5; // subtraction - 0
8+
9+
x = 5 * 5; // multiplication - 25
10+
11+
x = 5 / 5; // division - 1
12+
13+
x = 10 % 3; // operand - handles remainder 1
14+
15+
// 2. Concatenation - joining of two or more data type mostly string, we use the addition operator to concatenate
16+
17+
x = "Hello" + " " + "World"; // Hello World
18+
19+
// 3. Exponential
20+
21+
x = 4 ** 4; // 4 raise to power 4 = 235
22+
23+
x = 3 ** 3; // 27
24+
25+
console.log(x);

basics/types-conversion.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// type-conversion involves converting a data type to another, e.g number to string vice versa, etc
2+
3+
// NUMBER to STRING
4+
let x = 100;
5+
6+
// let output = x.toString(); // string
7+
8+
// convert from string to number
9+
10+
// let output = parseInt(x); // number
11+
12+
// convert from
13+
14+
console.log(output, typeof output);

index.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
body {
1616
font-family: "Poppins", sans-serif;
1717
padding: 0;
18-
box-sizing: border-box;
1918
margin: 0;
19+
box-sizing: border-box;
2020
}
2121
</style>
2222
</head>
@@ -35,7 +35,7 @@ <h3 class="text-6xl font-semibold text-black items-center">
3535
class="text-white capitalize font-medium font-base active:scale-[0.97] transition-all duration-300 bg-blue-500 w-[100px] py-3.5 rounded"
3636
onclick="startTimer()"
3737
>
38-
Start
38+
Start/play
3939
</button>
4040
<button
4141
class="text-white capitalize font-medium font-base active:scale-[0.97] transition-all duration-300 bg-yellow-500 w-[100px] py-3.5 rounded"
@@ -145,5 +145,7 @@ <h3 class="text-6xl font-semibold text-black items-center">
145145
// Initial display
146146
updateTimerDisplay();
147147
</script>
148+
<!-- test js file -->
149+
<script src="script.js" type="text/javascript"></script>
148150
</body>
149151
</html>

0 commit comments

Comments
 (0)