Javascript Dev 1 Cert Flashcards
1
Q
What are 3 ways to create Objects?
A
- Object literal
- Object constructor
- Object.create()
2
Q
What way is this Object being instantiated?
var x = {} var detail = { name: "nikhil" }
A
Object literal
3
Q
What way is this Object being instantiated?
var x = new Object() x.name = "nikhil" console.log(x)
A
Object constructor
4
Q
What way is this Object being instantiated?
var obj = { name: "nikhil" } var newObj = Object.create(obj)
A
Object.create() method
5
Q
What is the output?
typeof 23.783
A
Number
6
Q
What is the output?
typeof NaN
A
Number
7
Q
What is the output?
typeof 0
A
Number
8
Q
What is the output?
typeof 0
A
Number
9
Q
What is the output?
typeof "true"
A
String
10
Q
What is the output?
var x typeof x
A
undefined
11
Q
What is the output?
typeof null
A
object
12
Q
What is the output?
typeof {}
A
object
13
Q
What is the output?
typeof !!(1)
A
Boolean
14
Q
What is the output?
typeof function () { }
A
function
15
Q
What is the output?
typeof new Date()
A
Object
16
Q
What is the output?
String(23)
A
‘23’
17
Q
What is the output?
String(undefined)
A
‘undefined’
18
Q
What is the output?
String(null)
A
‘null’
19
Q
What is the output?
String("23")
A
‘23’
20
Q
What is the output?
String(true)
A
‘true’
21
Q
What is the output?
Number(null)
A
0