JavaScript low (1-3) importance

Problem 2016-02-10-17-10

complexity: 2 ; importance: 3; author: docentmail

Question: Is this a valid JavaScript snippet?

var 
foo
=
10
alert(foo)


Problem 2016-02-20-13-13

complexity: 2 ; importance: 3; author: docentmail

Question:What is the generic name of the values which evaluates to true?


Problem 2016-02-20-13-16

complexity: 2 ; importance: 3; author: docentmail

Question:What is the generic name of the values which evaluates to false?


Problem 2015-12-18-15-36

complexity: 1 ; importance: 3; author: docentmail

Question: Give two variants how to access "name" property of given cat object.

var cat = {name:"Peter", hi:function() {alert("Hello my friend");}}


Problem 2015-12-19-18-45

complexity: 1 ; importance: 3; author: 4luckynikta

Question:How can you define the text John Doe as a string


Problem 2015-12-12-15-57

complexity: 1 ; importance: 3; author: 4luckynikita

Question: Which of the following lines are correct?

var x = 5; 
var x = // my comment   5 ;
var x = 5; // my comment
var x = 5 // my comment   ;
// var x = 5; 


Problem 2016-02-10-17-15

complexity: 2 ; importance: 3; author: docentmail

Question: Write the snippet into a single line. Insert semicolons to make the snippet understandable and not to change the snippet logic.

x = d 
(f+g ).some_method()


Problem 2016-02-10-17-12

complexity: 2 ; importance: 3; author: docentmail

Question: What is result of execution of the snippet?

function a(){
     return
       1;
}
alert (a());


Problem 2015-12-30-22-25

complexity: 2 ; importance: 3; author: docentmail

Question: is this a valid JS statement?

var x= "Hello", cat= "Bob", height = 20;


Problem 2016-02-10-17-08

complexity: 2 ; importance: 3; author: docentmail

Question: Are these a valid JavaScript statements?

i       ++;
i
++;


Problem 2015-12-29-20-21

complexity: 2 ; importance: 3; author: docentmail

Question: replace the statement

var x= "Hello", cat= "Bob", height = 20;
with multiple statements where each statement contains only one "=". And they doing the same.


Problem 2015-12-17-16-47

complexity: 2 ; importance: 2; author: docentmail

Question: What will return typeof x; and typeof y;?

var x = 123;
var y = new Number(123);


Problem 2015-12-17-16-44

complexity: 2 ; importance: 2; author: docentmail

Question: Where is a literal in the expression?

var x = 5;


Problem 2015-12-17-16-46

complexity: 2 ; importance: 2; author: docentmail

Question:Give two different approaches to create an array


Problem 2015-12-29-18-05

complexity: 1 ; importance: 2; author: docentmail, 4luckynikita

Question:Name this char '


Problem 2015-12-14-09-02

complexity: 2 ; importance: 2; author: docentmail

Question: What is the purpose of typeof operator?


Problem 2015-12-14-08-56

complexity: 2 ; importance: 2; author: docentmail

Question: Question: What will "x" equal?

var x = 16 + 4 + "Volvo";


Problem 2015-12-13-16-07

complexity: 2 ; importance: 2; author: 4luckynikita, rorp32, DogeLover1337, TimberWolf91

Question: Question: What will "x" equal?

var x = "Volvo" + 16 + 4;


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-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 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-27-12-37

complexity: 1 ; importance: 2; author: docentmail, 4luckynikita

Question:Assign number value to variable


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};


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-30

complexity: 2 ; importance: 2; author: docentmail

Question: What would be message of the alert?

function fun(aaa   /* some comments */ ){
 // this is another comment
 return 'hello';
}

alert (fun);


Problem 2015-12-03-10-21

complexity: 2 ; importance: 2; author: docentmail

Question: what does alert (x[1]); show?

var x = [1,2,3];
var y = x;
y[1]=100;
alert (x[1]);


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))