Assignment 1 - Javascript PDF
Assignment 1 - Javascript PDF
Ques 1) Find the output of the followings (along with the reasons):-
b) for(let j = 0; j<10;ji++){
console.log("j >>>>" , j);
setTimeout(function(){
console.log(j);
},1000)
}
a) function abc(){
console.log(b)
}
let b = 'delta';
abc();
b) function abc(){
console.log(c)
}
abc();
let c = 'delta';
Ques 3) Write a JavaScript program to display the current day and time in the following format.
Sample Output : Today is : Tuesday.
Current time is : 10 PM : 30 : 38
Ques 4) The _____ method of an Array object adds and/or removes elements from an array.
A. Reverse
B. Shift
C. Slice
D. Splice
Ques 6) Write the output for the following code, also define reason
var a=10
func()
Q7) - Which of the following is the output of the below JavaScript code?
1. "undefined"
2. "number"
3. "string"
4. "object"
Ques 8) Select the output for the following code , also explain it
1. Success
2. not success
3. 1
4. undefined