Notes
Notes - notes.io |
(function(){
var a = b = 3;
})();
console.log( (typeof b !== 'undefined'));
True
What will the code below output? Explain your answer.
console.log(0.1 + 0.2 == 0.3);
False
What will be the output of the following code
for (var i = 0; i < 5; i++) {
setTimeout(function() { console.log(i); }, i * 1000 );
}
5, 5, 5, 5, 5
What will be the output of the following code:
for (var i = 0; i < 5; i++) {
(function(x) {
setTimeout(function() { console.log(x); }, x * 1000 );
})(i);
}
0, 1, 2, 3, 4
What will be the output when the following code is executed?.
console.log(false === '0')
False
What is the output out of the following code? Explain your answer.
var a={},
b={key:'b'},
c={key:'c'};
a[b]=123;
a[c]=456;
console.log(a[b]);
456
Consider the code snippet below. What will the console output?
(function(x) {
return (function(y) {
console.log(x);
})(2)
})(1);
1
What will the following code output to the console:
var hero = {
_name: 'John Doe',
getSecretIdentity: function (){
return this._name;
}
};
var stoleSecretIdentity = hero.getSecretIdentity;
console.log(stoleSecretIdentity());
undefined
hat is the output of the following code?
var length = 10;
function fn() {
console.log(this.length);
}
var obj = {
length: 5,
method: function(fn) {
fn();
arguments[0]();
}
};
obj.method(fn, 1);
2,10
Consider the following code. What will the output be?
(function () {
try {
throw new Error();
} catch (x) {
var x = 1, y = 2;
console.log(x);
}
})();
1
What will be the output of this code?
var x = 21;
var girl = function () {
console.log(x);
var x = 20;
};
girl ();
undefined
What do the following lines output?
console.log(3 > 2 > 1);
False
What would following code return?
console.log(typeof typeof 1);
string
What will the following code output?
var b = 1;
function outer(){
var b = 2
function inner(){
b++;
var b = 3;
console.log(b)
}
inner();
}
outer();
3
What will be the output of the code below?
function isInt(num) {
return num % 1 === 0;
}
console.log(isInt(12.2));
False
What will be the output of the code below?
var y = 1;
if (function f(){}) {
y += typeof f;
}
console.log(y);
1undefined
What will be the output of the following code?
var output = (function(x){
delete x;
return x;
})(0);
console.log(output);
1
What will be the output of the code below?
var x = { foo : 1};
var output = (function(){
delete x.foo;
return x.foo;
})();
console.log(output);
undefined
What will be the output of the code below?
var Employee = {
company: 'xyz'
}
var emp1 = Object.create(Employee);
delete emp1.company
console.log(emp1.company);
xyz
What will be the output of the following code:
for (let i = 0; i < 5; i++) {
setTimeout(function() { console.log(i); }, i * 1000 );
}
0, 1, 2, 3, 4
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team