JavaScript average (4-7) complexity

Problem 2016-02-11-23-48

complexity: 6 ; importance: 2; author: docentmail

Question: Why do you get the error Fix errors in you script: TypeError: a is not a function for the snippet?

var a=1
var b=a
(function() {
   alert('hello');
})();


Problem 2016-02-11-17-15

complexity: 5 ; importance: 2; author: docentmail

Question: Give values for variables a and b to force first alert print true and second prints false.

var a=?;
var b=?;
    
alert(' a == b '  + (a == b) );
alert(' a===b '+ (a === b) );


Problem 2016-02-11-17-00

complexity: 5 ; importance: 2; author: docentmail

Question: What is the name of the practice and what is the purpose of starting libraries with ";"?

;(function () {.......


Problem 2016-01-17-04-15

complexity: 5 ; importance: 4; author: docentmail

Question: What would be result of execution of the snippet?

function myFunction(){
  alert("Hello from myFunction ");
}

function testFunctionHoisting(){
   alert(typeof myFunction);
    
   myFunction();  

   var myFunction = function() {
       alert("hello from local myFunction");  
   };
}
testFunctionHoisting();


Problem 2015-12-16-17-06

complexity: 5 ; importance: 2; author: docentmail

Question: how many times method do() would be called?

for (i = 0, j=3; i < j; i++,j-- ) { 
   do();
}


Problem 2015-12-16-20-07

complexity: 5 ; importance: 1; author: docentmail

Question: What would be result of execution of expresion?

typeof typeof 123 
   or the same with parenthis 
     typeof(typeof(123))


Problem 2016-02-20-23-51

complexity: 4 ; importance: 5; author: docentmail

Question:Which version of ECMA script is supported by current browsers?


Problem 2016-03-24-23-49

complexity: 4 ; importance: 5; author: docentmail

Question: Develop an snippet to use "if" statement to alert "type is number" if in case the type variable "theVar" is number, "type is string" if type is string less, "type is something else" otherwise.

      


Problem 2016-02-21-13-07

complexity: 4 ; importance: 5; author: docentmail

Question:Why standard for JavaScript has name ECMAScript?


Problem 2016-02-20-12-48

complexity: 4 ; importance: 5; author: docentmail

Question:List all falsy values.


Problem 2015-12-31-23-01

complexity: 4 ; importance: 2; author: docentmail

Question: What world would be the result for each line?

typeof "John";
typeof 3.14;
typeof false;
typeof [1,2,3,4];
typeof {name:'John', age:34};