JavaScript low (1-3) complexity

Problem 2015-12-14-09-12

complexity: 3 ; importance: 5; author: docentmail

Question: Replace with the code fragment, with equals one that only one “.” per line/statement

var rez = document.getElementById("testspan").getAttribute("class").length;


Problem 2016-02-21-13-10

complexity: 3 ; importance: 5; author: docentmail

Question:What is percentage of support ECMAScript 6.0 in modern browsers?


Problem 2016-02-21-13-38

complexity: 3 ; importance: 5; author: docentmail

Question:What is percentage of support ECMAScript 5 in modern browsers?


Problem 2015-12-29-19-38

complexity: 3 ; importance: 6; author: docentmail

Question: Use switch statement and write the code that alert Today is your day!


Problem 2015-12-18-15-21

complexity: 3 ; importance: 6; author: docentmail

Question: create object that has a "name" field and can alert text "Hello my friend" on calling his hi method


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

complexity: 2 ; importance: 5; author: docentmail

Question: What would be value of x?

var x = 100 / "Apple"; 


Problem 2015-12-17-16-49

complexity: 2 ; importance: 5; author: docentmail

Question: What would be value of x?

var x = 100 / "10";


Problem 2015-12-17-16-46

complexity: 2 ; importance: 2; author: docentmail

Question:Give two different approaches to create an array


Problem 2016-01-14-18-21

complexity: 2 ; importance: 5; author: docentmail

Question: Which of the names of variables are correct?

2things
something4you
my_variable_name
aaa+bbb
...
 


Problem 2015-12-18-16-11

complexity: 2 ; importance: 5; author: 4LUCKYNIKITA

Question: What would the alert say?

x=5
x += 5 + 2 
alert ( x ) ;


Problem 2016-01-14-23-45

complexity: 2 ; importance: 5; author: docentmail

Question: Name reserved keywords of JavaScript


Problem 2016-01-15-00-26

complexity: 2 ; importance: 5; author: docentmail

Question: Give code snippets with assignment operators.


Problem 2016-01-16-19-43

complexity: 2 ; importance: 8; author: docentmail

Question: Give the code snippet that declares variable aVar with value 10 in Global scope


Problem 2016-01-17-00-01

complexity: 2 ; importance: 8; author: docentmail

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

function func1() { 
   function func2() { 
       var theVar = 'Bye !'; 
       alert(theVar);
   }
}
func2();


Problem 2015-12-17-16-45

complexity: 2 ; importance: 4; author: docentmail

Question: How to assign last element of array b to var x


Problem 2015-12-29-20-02

complexity: 2 ; importance: 8; author: docentmail

Question: Is this valid JavaScript code?

var x= "Hello";
x=[1,2,3];
x=5;


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

complexity: 2 ; importance: 3; author: docentmail

Question: is this a valid JS statement?

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


Problem 2015-12-30-22-32

complexity: 2 ; importance: 6; author: docentmail

Question: Give a code fragment that declares a variable, but is not initializing it.


Problem 2016-01-17-00-27

complexity: 2 ; importance: 8; author: docentmail

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

var theVar = 'value0'; 
 
function func1() { 
var theVar="value1";
  function func2() { 
     alert(theVar);
  }
  func2();
}
func1();


Problem 2016-01-17-01-01

complexity: 2 ; importance: 8; author: docentmail

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

function func1() { 
     theVar="value1";
}

func1();

alert(theVar);


Problem 2016-01-17-01-18

complexity: 2 ; importance: 8; author: docentmail

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

function func1() { 
     var theVar="value1";
}

func1();
alert(theVar);


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-16-09-16

complexity: 2 ; importance: 4; author: docentmail

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

for (i = 0; i > 1 ; i++) { 
   do();
}


Problem 2016-03-24-23-45

complexity: 2 ; importance: 5; author: docentmail

Question: Develop an snippet to use "if" statement to alert "The size fits" in case the variable "size" value is greater than 5 but less than 7.

      


Problem 2016-03-24-23-42

complexity: 2 ; importance: 5; author: docentmail

Question: Modify the snippet to use "if" statement to alert "It is night." in case the variable "isNight" is true and "It is not night." otherwise.

      


Problem 2015-12-16-09-09

complexity: 2 ; importance: 4; author: docentmail

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

for (i = 0; i < 1 ; i) { 
   do();
}


Problem 2015-12-16-08-57

complexity: 2 ; importance: 5; author: docentmail

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

for (i = 0; i < 1 ; i++) { 
   do();
}


Problem 2015-12-14-09-02

complexity: 2 ; importance: 2; author: docentmail

Question: What is the purpose of typeof operator?


Problem 2016-02-20-23-57

complexity: 2 ; importance: 6; author: docentmail

Question:What is the latest standard of ECMA script?


Problem 2015-12-14-08-56

complexity: 2 ; importance: 2; author: docentmail

Question: Question: What will "x" equal?

var x = 16 + 4 + "Volvo";


Problem 2016-02-20-23-40

complexity: 2 ; importance: 4; author: docentmail

Question:What is the name of organization that maintains JavaScript standards?


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

complexity: 2 ; importance: 5; author: docentmail

Question:Give definition for "truthy/falsy values" with if statement.


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-01-14-18-07

complexity: 2 ; importance: 4; author: docentmail

Question: Name main parts (or aspects) of variable


Problem 2016-02-11-23-31

complexity: 2 ; importance: 24; author: docentmail

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

var x=1, y=1;
x
--
y
alert(x);
alert(y);


Problem 2016-02-11-17-42

complexity: 2 ; importance: 24; author: docentmail

Question: What is typeof null;?

alert(typeof null);


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-03-10-20

complexity: 2 ; importance: 4; author: docentmail

Question: what does alert (x); show?

var x = 1;
var y = x;
y=101;
alert (x);


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 2016-01-17-01-28

complexity: 2 ; importance: 8; author: docentmail

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

var theVar="value0";     
for (var i=0; i<10; i++) { 
     var theVar="value1";
}

alert(theVar);


Problem 2016-02-10-17-08

complexity: 2 ; importance: 3; author: docentmail

Question: Are these a valid JavaScript statements?

i       ++;
i
++;


Problem 2016-01-17-04-52

complexity: 2 ; importance: 5; author: docentmail

Question: What would be alert messges for the code snippet?

alert(typeof myFunction);
alert(typeof OtherFunction);

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

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


Problem 2016-01-17-04-41

complexity: 2 ; importance: 8; author: docentmail

Question: Is this valid to call function before it is declared?

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


Problem 2016-03-24-23-47

complexity: 2 ; importance: 5; author: docentmail

Question: Develop an snippet to use "if" statement to alert "You are to young" in case the variable "age" is less or equal 17.

      


Problem 2016-01-17-03-49

complexity: 2 ; importance: 5; author: docentmail

Question: What would be the alert message for the code snippet?

alert(aVar);
var aVar=5;


Problem 2016-01-17-03-36

complexity: 2 ; importance: 8; author: docentmail

Question: Give the code snippet that declares variable aVar with value 10 in local scope and not visible in Global scope


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 2015-12-31-20-44

complexity: 1 ; importance: 7; author: docentmail

Question: What should be placed instead of dots to have method do (); performed only when x does not equal y ?

if (x ... y) {
  do();
}


Problem 2015-12-30-22-40

complexity: 1 ; importance: 7; author: docentmail

Question: What is the name of "=" operators ?


Problem 2015-12-29-18-05

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

Question:Name this char '


Problem 2015-12-28-12-07

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

Question:Name the main four arithmetical operations.


Problem 2015-12-27-12-37

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

Question:Assign number value to variable


Problem 2016-01-15-00-12

complexity: 1 ; importance: 4; author: docentmail

Question: Give the code snippet to declare (or define) variable myVar but not initialize it. What is value of the variable?


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-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-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-01-14-17-38

complexity: 1 ; importance: 7; author: docentmail

Question: Give sample of JavaScript code block