File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 1
1
// alert("Hello")
2
2
console . log ( "Hey Atul" )
3
3
4
+ /*
4
5
// Console Object Methods
5
6
console.log("log")
6
7
console.info("This is an info")
@@ -10,19 +11,30 @@ console.assert("error" != false)
10
11
console.assert("error" == false)
11
12
12
13
console.time("forLoop")
13
-
14
- for ( let i = 0 ; i < 500 ; i ++ ) {
14
+ for (let i = 0; i < 10; i++) {
15
15
console.log(233)
16
16
}
17
-
18
17
console.timeEnd("forLoop")
19
18
20
19
console.time("whileLoop")
21
-
22
20
let i = 0;
23
- while ( i < 500 ) {
21
+ while (i < 10 ) {
24
22
console.log(233)
25
23
i++;
26
24
}
25
+ console.timeEnd("whileLoop")
26
+ */
27
27
28
- console . timeEnd ( "whileLoop" )
28
+
29
+ //Interaction: alert, prompt, confirm
30
+ alert ( "Enter the value of a!" )
31
+ let a = prompt ( "Enter a here" , "578" )
32
+ a = Number . parseInt ( a )
33
+ alert ( "You entered a of type " + ( typeof a ) )
34
+ let write = confirm ( "Do you want to write it to the page" )
35
+ if ( write ) {
36
+ document . write ( a )
37
+ }
38
+ else {
39
+ document . write ( "Please allow me to write" )
40
+ }
You can’t perform that action at this time.
0 commit comments