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

NaN

23
Q

What is the output?

Number('hello')
A

NaN

24
Q

What is the output?

Number([])
A

0

25
Q

What is the output?

Number([33, 33])
A

NaN

26
Q

What is the output?

Number(['523'])
A

523

27
Q

What is the output?

Number([63.45])
A

63.45

28
Q

What is the output?

Boolean('')
A

false

29
Q

What is the output?

Boolean(' ')
A

true

30
Q

What is the output?

Boolean(undefined)
A

false

31
Q

What is the output?

Boolean(null)
A

false

32
Q

What is the output?

Boolean(NaN)
A

false

33
Q

What is the output?

100 == "100"
A

true

34
Q

What is the output?

100 === "100"
A

false

35
Q

What is the output?

true == 1
A

true

36
Q

What is the output?

true === 1
A

false

37
Q

What is the output?

NaN === NaN
A

false

38
Q

What is the output?

- 0 == 0
A

true

39
Q

What is the output?

NaN == NaN
A

false

40
Q

What is the output?

- 0 === 0
A

true

41
Q

What is the output?

[] === []
A

false

42
Q

What is the output?

[] == []
A

false

43
Q

What is the output?

Object.is(100, "100")
A

false

44
Q

What is the output?

var x = 10
console.log(x++)
A

10

45
Q

What is the output?

var x = 10
x++
console.log(x);
A

11

46
Q

What is the output?

var x = []
var y = x
x === y
A

true

47
Q

What is the output?

"Hello" + "World"
    \+ "16546542"
A

‘HelloWorld16546542’

48
Q

What is the output?

100 + "world"
A

‘100world’

49
Q

What is the output?

100 + null + 20 + "world"
A

‘120world’

50
Q

What is the output?

true + 1 + "hey"
A

‘2hey’

51
Q

What is the output?

undefined + 2
A

NaN

52
Q

What is the output?

100 + 200 + undefined + "hey"
A

NaNhey

53
Q

What is the output?

undefined + 2
A

NaN