What is 'this’ in JavaScript?

Written by suhas010 | Published 2021/05/04
Tech Story Tags: javascript | reactjs | web-development | frontend-development | javascript-fundamentals | development | javascript-development | understanding-javascript

TLDR 'this' is always been a pain in the a** for many JavaScript developers, but it’s time to say ‘I got this’ Previously, I wrote Understanding Scope and Context in JavaScript. JavaScript will create a separate execution context for a function called with a new keyword. The value of this is determined by how a function is being called. JavaScript has introduced a new property called globalThis which points to global this or global this. In a web browser, the value of global this is different in NodeJS (Object), and in WebWorker it might be DedicatedWorkerGlobalScope.via the TL;DR App

no story

Written by suhas010 | JavaScript enthusiastic, in love with ReactJS
Published by HackerNoon on 2021/05/04