Java Script

How '' works in below code...?

var phonebookEntry = {}; = 'Oxnard Montalvo';
phonebookEntry.number = '(555) 555-5555'; = function() {
console.log('Calling ' + + ' at ' + this.number + '...');



If you're just asking how it works in the first place I can give an explanation...but I'm not sure that's what you mean. Is there something wrong with the code? Doesn't look like it.

Basically, the word "" means the name attribute attached to whatever function mentioned it last.

You can technically use but because you're using the .name value inside of the function it was called you can use this. this function, basically, is how I hthink of it.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.