Javascript Dev 1 Cert Flashcards

1
Q

What are 3 ways to create Objects?

A
  1. Object literal
  2. Object constructor
  3. Object.create()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What way is this Object being instantiated?

var x = {}
var detail = {
                name: "nikhil"
}
A

Object literal

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

What way is this Object being instantiated?

var x = new Object()
x.name = "nikhil"
console.log(x)
A

Object constructor

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

What way is this Object being instantiated?

var obj = {
          name: "nikhil"
			 }
var newObj = Object.create(obj)
A

Object.create() method

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

What is the output?

typeof 23.783
A

Number

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

What is the output?

typeof NaN
A

Number

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

What is the output?

typeof 0
A

Number

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

What is the output?

typeof 0
A

Number

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

What is the output?

typeof "true"
A

String

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

What is the output?

var x
typeof x
A

undefined

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

What is the output?

typeof null
A

object

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

What is the output?

typeof {}
A

object

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

What is the output?

typeof !!(1)
A

Boolean

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

What is the output?

typeof function () { }
A

function

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

What is the output?

typeof new Date()
A

Object

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

What is the output?

String(23)
A

‘23’

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

What is the output?

String(undefined)
A

‘undefined’

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

What is the output?

String(null)
A

‘null’

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

What is the output?

String("23")
A

‘23’

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

What is the output?

String(true)
A

‘true’

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

What is the output?

Number(null)
A

0

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

What is the output?

Number(undefined)
23
Q

What is the output?

Number('hello')
24
Q

What is the output?

Number([])
25
# What is the output? ``` Number([33, 33]) ```
NaN
26
# What is the output? ``` Number(['523']) ```
523
27
# What is the output? ``` Number([63.45]) ```
63.45
28
# What is the output? ``` Boolean('') ```
false
29
# What is the output? ``` Boolean(' ') ```
true
30
# What is the output? ``` Boolean(undefined) ```
false
31
# What is the output? ``` Boolean(null) ```
false
32
# What is the output? ``` Boolean(NaN) ```
false
33
# What is the output? ``` 100 == "100" ```
true
34
# What is the output? ``` 100 === "100" ```
false
35
# What is the output? ``` true == 1 ```
true
36
# What is the output? ``` true === 1 ```
false
37
# What is the output? ``` NaN === NaN ```
false
38
# What is the output? ``` - 0 == 0 ```
true
39
# What is the output? ``` NaN == NaN ```
false
40
# What is the output? ``` - 0 === 0 ```
true
41
# What is the output? ``` [] === [] ```
false
42
# What is the output? ``` [] == [] ```
false
43
# What is the output? ``` Object.is(100, "100") ```
false
44
# What is the output? ``` var x = 10 console.log(x++) ```
10
45
# What is the output? ``` var x = 10 x++ console.log(x); ```
11
46
# What is the output? ``` var x = [] var y = x x === y ```
true
47
# What is the output? ``` "Hello" + "World" + "16546542" ```
'HelloWorld16546542'
48
# What is the output? ``` 100 + "world" ```
'100world'
49
# What is the output? ``` 100 + null + 20 + "world" ```
'120world'
50
# What is the output? ``` true + 1 + "hey" ```
'2hey'
51
# What is the output? ``` undefined + 2 ```
NaN
52
# What is the output? ``` 100 + 200 + undefined + "hey" ```
NaNhey
53
# What is the output? ``` undefined + 2 ```
NaN