This keyword in JavaScript arrow function | Example code

  • by

JavaScript Arrow functions have no this value in their scope, so you can access this value of the object. But Normal functions have this value in their scope.

This keyword in the JavaScript arrow function

A simple example code value of the normal function is global this or window. and it allows to you access the global scope.

<!DOCTYPE html>

    var greeting = 'Hi';
    const obj = {
      greeting: 'Hey Arrow Function',
      fo() {
        const greeting = 'Hola';
        fo2 =  () => {
          const greeting = 'Hello';
          const arrowFo = () => {




This keyword in JavaScript arrow function


Do comment if you have any doubts or suggestions on this JS this keyword.

Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.