Javascript Dev 1 Cert Flashcards
What are 3 ways to create Objects?
- Object literal
- Object constructor
- Object.create()
What way is this Object being instantiated?
var x = {} var detail = { name: "nikhil" }
Object literal
What way is this Object being instantiated?
var x = new Object() x.name = "nikhil" console.log(x)
Object constructor
What way is this Object being instantiated?
var obj = { name: "nikhil" } var newObj = Object.create(obj)
Object.create() method
What is the output?
typeof 23.783
Number
What is the output?
typeof NaN
Number
What is the output?
typeof 0
Number
What is the output?
typeof 0
Number
What is the output?
typeof "true"
String
What is the output?
var x typeof x
undefined
What is the output?
typeof null
object
What is the output?
typeof {}
object
What is the output?
typeof !!(1)
Boolean
What is the output?
typeof function () { }
function
What is the output?
typeof new Date()
Object
What is the output?
String(23)
‘23’
What is the output?
String(undefined)
‘undefined’
What is the output?
String(null)
‘null’
What is the output?
String("23")
‘23’
What is the output?
String(true)
‘true’
What is the output?
Number(null)
0
What is the output?
Number(undefined)
NaN
What is the output?
Number('hello')
NaN
What is the output?
Number([])
0
What is the output?
Number([33, 33])
NaN
What is the output?
Number(['523'])
523
What is the output?
Number([63.45])
63.45
What is the output?
Boolean('')
false
What is the output?
Boolean(' ')
true
What is the output?
Boolean(undefined)
false
What is the output?
Boolean(null)
false
What is the output?
Boolean(NaN)
false
What is the output?
100 == "100"
true
What is the output?
100 === "100"
false
What is the output?
true == 1
true
What is the output?
true === 1
false
What is the output?
NaN === NaN
false
What is the output?
- 0 == 0
true
What is the output?
NaN == NaN
false
What is the output?
- 0 === 0
true
What is the output?
[] === []
false
What is the output?
[] == []
false
What is the output?
Object.is(100, "100")
false
What is the output?
var x = 10 console.log(x++)
10
What is the output?
var x = 10 x++ console.log(x);
11
What is the output?
var x = [] var y = x x === y
true
What is the output?
"Hello" + "World" \+ "16546542"
‘HelloWorld16546542’
What is the output?
100 + "world"
‘100world’
What is the output?
100 + null + 20 + "world"
‘120world’
What is the output?
true + 1 + "hey"
‘2hey’
What is the output?
undefined + 2
NaN
What is the output?
100 + 200 + undefined + "hey"
NaNhey
What is the output?
undefined + 2
NaN