Typescript/Javascript ES6) Flashcards
What type of element can be hoisted to the top of the current scope
Variable declaration only; NOT declaration and assignment
How is a LET variable scoped
Block scoped; the current function or if or …
How is a VAR variable scoped
var is Function scoped.
When can you remove the parens in and arrow function declaration?
When there is only a single input parameter
How is sort() used WITH an input array?
sortedArr = numberArr.sort( (a,b) => a > b ? 1: -1);
Write the destructured assignment for:
x = [15, 07, 2015];
a = 15;
b = 07;
c = 2015;
var [a, b, c] = [15, 07, 2015]
Show assigning m and y from a function X( ) returning
{ d:15, m:07, y:2015}. Use destructuring.
var { , m, y } = X( );
Show assigning default values to function x( a, b);
function x( a = 1, b = “test”);
var course = { name: “javascript”, length: 15 };
function test(c) { let { first, second, third } = c; //destructure ... }
How can you make ‘third’ optional.
?third
JavaScript have following type of Comment(s).
A Single Line Comments
B Multiple Line Comments
C All of the above
D None of the above
C All of the above
Single Line Comments
Multiple Line Comments
Which of the following is considered as End of Single line comment ?
A End of Line
B End of Statement
C Semicolon
D None of the above
B End of Statement
Comments in JS are ignored by
A Compiler
B JVM
C Operating System
D Browser
A Compiler
Comment Statement is _____ type of statement.
A Non Important
B Non Executable
C Executive
D Non Usable
B Non Executable
Person XYZ wrote his name and date of code creation at the start. What kind of comment has he written ?
A Functional Comment
B Documentation Comment
C Code Hiding Comment
D None of the above
B Documentation Comment
Which of the following is not a compound assignment operator ?
A ===
B <<=
C +=
D >>=
A ===
operators that perform the specified operation on the right-side value before assigning a value to the left side.
x += y
x -= y
x *= y
x /= y
x %= y
bitwise:
(BitWise OR)
^ (Bitwise XOR)
~ (Bitwise Not)
<< (Left Shift)
>> (Right Shift)
>>> (Right shift with Zero)
Again, with = following, make operation occur on the right before assignment.