javascript part 1 Flashcards

1
Q

java is ____ type of language

A

strong

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

javascript is _____ type of language

A

weak

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Supports object-oriented and imperative programming styles was standardised as ECMScript 1. True or False?

A

False. it is ECMAScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 6 primitive type of javascript?

A
undefined 
variables
null value denoting intentional lack of a value
Boolean 
Number 
String
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

anon = function() { print(‘I am hii’); }

if you want to use this function. what would you type?

A

anon();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

anon = function() { print(‘oh’); }

What type of function is this?

A
Anonymus function. it would be defined if we had written it as:
function anon()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

method to return character at index N

A

charAt(N)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

method to returns index of S in string

A

indexOf(S)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

method to returns last index of S in string

A

lastIndexOf(S)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what does the .length method do?

A

returns length of string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

method to returns array of substrings separated by S

A

Split(S)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

substring(M) will output:

A

returns substring from index to end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

substring(M, N) will output:

A

returns substring from element M to N.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

how to add two strings without the + symbol

A

a.concat(b)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

let arr = [‘a’, 2, ‘c’];
alert( arr[9] );
what will be the output?

A

array out of boundary.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what method would you use to get an array without the repeated elements. for example:
arry = [2,6,2,5,7];
will output
arry = [2,6,5,7];

A

filter()

17
Q

what does the map() function do?

A

map function will apply function to each element.
for example we have an array 1,2,3,4
and want to add 1 to all the elements. we would use the map function

18
Q

method that applies accumulator/concatenator across array elements

A

reduce()

19
Q

javascript objects are primative. True or False?

A

False. they are non primitaive

20
Q

javascript objects have ____ that are also objects and they inherit properties and methods from that.

A

prototype

21
Q

All objects inherit from prototype are called?

A

Object.prototype.

22
Q

ES 6 introduced class notation to JavaScript where

A

classes are syntactic sugar over prototype-based objects and no new object-oriented model is introduced

23
Q

javacript is single threaded. True or false?

A

False. It is multithreaded