Created
October 23, 2013 19:44
-
-
Save davit-khaburdzania/7125372 to your computer and use it in GitHub Desktop.
questions about Javascript questions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1. returned values | |
(function () {}) === (function () {}) // ==> | |
(function () {}) == (function () {}) // ==> | |
(function () {}) == (function () {})() // ==> | |
(function () {})() == (function () {})() // ==> | |
(function () {})() === (function () {})() // ==> | |
(function () {})() == undefined // ==> | |
(function () {})() == null // ==> | |
null === (function () {})() // ==> | |
(function () {})() === undefined // ==> | |
//2. three ways to generate undefined value | |
//3. variable shadowing | |
(function (x) { | |
console.log(x); | |
(function () { | |
var x; | |
console.log(x); | |
x = 22 | |
console.log(x); | |
})(); | |
console.log(x) | |
})(2) | |
//4.1 function naming | |
var viri = function wero () { | |
console.log(viri); | |
console.log(wero); | |
} | |
viri(); | |
wero(); | |
//4.2 function naming | |
var x; | |
console.log(wero()) | |
function wero () { | |
return x; | |
} | |
var x = 22; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment