In the following example why does the whois() function have access to displayName2 and name1?
function whois({displayName: displayName2, fullName: {firstName: name1}}){
console.log(`${displayName2} is ${name1}`)
}
let user = {
displayName: "jdoe",
fullName: {
firstName: "John",
lastName: "Doe"
}
}
whois(user) // "jdoe is John"
To the untrained eye it looks like it should have access to displayName and fullName.firstName. The destructuring looks like JSON in reverse.
What's happening under the hood?