My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

JavaScript Code Snippet

Alok Deshwal's photo
Alok Deshwal
·Aug 2, 2021·

1 min read

throw an Error at return function itself

0%

syntax error unexpected token 'return'

0%

I am a var keyword

100%

None of the above

0%

1 vote · Closed

   class A { 
      constructor() { } 
      return() { return 'I am a return keyword' }
      var() { return 'I am a var keyword'}
   }
   console.log(new A().var())