Skip to content

Latest commit

 

History

History
65 lines (54 loc) · 1 KB

Readme.md

File metadata and controls

65 lines (54 loc) · 1 KB

Want to Contribute?

Check this How to edit md file?

Question 1

function foo(a){
  demo();
  function demo(){
   console.log('Inside Demo function'); 
  }
}
foo();
foo(undefined);
foo(function(){ 
    console.log('Inside Anonymous function'); 
});

Question 2

setTimeout(function(){
    console.log('Inside 1');
    setTimeout(function(){
        console.log('Inside 2');
    },1000)
},1000);

setTimeout(function(){
    console.log('Inside 3');
},1000)

Question 3

const arr = ['1000','2000','3000',3000];

for(var i =0 ; i< arr.length;arr++){
    setTimeout(function(){
        console.log(` value at ${i} index: ${arr[i]} `);
},1000)
}

Question 4

let obj = {
    a:0,
    b:0
};

obj = {
    a:2,
    b: obj.a
};
console.log(obj);

Question 5

['123', '456', '789', '10'].map(parseInt);

Explanation