For the following questions, select the correct option:
- JavaScript is inherently:
- Synchronous
- Asynchronous
- Both
- A fetch() call returns a:
- then
- next
- finally
- Promise
- With prototypal inheritance, we can (select all):
- Add methods to a base data type.
- Subtract methods from a base data type.
- Rename our data type.
- Cast our data into another format.
let x = !!1
console.log(x)
- From the preceding code, what will be the expected output?
- 1
- false
- 0
- true
const Officer = function(name, rank, posting) {
this.name = name
this.rank = rank
this.posting = posting
this.sayHello = () => {
console.log(this.name)
}
}
const Riker = new Officer("Will Riker", "Commander", "U.S.S. Enterprise")
- In the preceding code, what's the best way to output Will Riker?
- Riker.sayHello()
- console.log(Riker.name)
- console.log(Riker.this.name)
- Officer.Riker.name()