What will happen when the following code is executed? var x = 5; console.log(x); if ( true ) { var x = 6; console.log(x); } console.log(x); //The Output will be - 5 6 6 What will happen when the following code is executed? var x = 5; console.log(x); if ( false ) { var x = 6; console.log(x); } console.log(x); //The Output will be - 5 5 What will happen when the following code is executed? var x = 5; function a() { var x = 6; return x; } console.log(x); console.log(a()); //The Output will be - 5 6 What will happen when the following code is executed? var x = 5; function a() { x = 6; return x; } console.log(x); console.log(a()); //The Output will be - 5 6 What will happen when the following code is executed? var x = ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers