this inside function javascript code example
Example 1: javascript this
console.log(this === window);
a = 37;
console.log(window.a);
this.b = "MDN";
console.log(window.b)
console.log(b)
Example 2: function inside function javascript
function getFullName() {
return getName() + ' ' + getLastName();
function getName() {
return 'William';
}
function getLastName() {
return 'Wallace';
}
}
console.log(getFullName());
console.log(typeof getFullName);
console.log(typeof getName);
console.log(typeof getLastName);