function returnName() {
var name = 'Stack Overflow'
console.log(this.name)
}
When I call this function, instead of printing the name 'Stack Overflow' Google Chrome console is returning 'undefined'.
Why is this behaviour? As I have read this keyword always refer to the current execution context then why it is not returning the name?