hard20 pts · first answer countsjavascriptthis-binding
Losing this when a method is extracted
This script runs in strict mode. What does it print?
'use strict'
const user = {
name: 'Asha',
greet() { return 'Hi ' + this.name },
}
const greet = user.greet
try { console.log(greet()) } catch (e) { console.log(e.constructor.name) }
console.log(greet.call({ name: 'Ravi' }))