René's URL Explorer Experiment


Title: this - JavaScript | MDN

Open Graph Title: this - JavaScript | MDN

Description: The this keyword refers to the context where a piece of code, such as a function's body, is supposed to run. Most typically, it is used in object methods, where this refers to the object that the method is attached to, thus allowing the same method to be reused on different objects.

Open Graph Description: The this keyword refers to the context where a piece of code, such as a function's body, is supposed to run. Most typically, it is used in object methods, where this refers to the object that the method is attached to, thus allowing the same method to be reused on different objects.

Opengraph URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this

direct link

Domain: developer.mozilla.org

og:localeen_US
og:imagehttps://developer.mozilla.org/mdn-social-image.46ac2375.png
og:image:typeimage/png
og:image:height1024
og:image:width1024
og:image:altThe MDN logo
og:site_nameMDN Web Docs
twitter:cardsummary
twitter:creatorMozDevNet
position5

Links:

Skip to main contenthttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#content
Skip to searchhttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#mdn-search
MDN https://developer.mozilla.org/en-US/
HTML: Markup languagehttps://developer.mozilla.org/en-US/docs/Web/HTML
Elementshttps://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements
Global attributeshttps://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes
Attributeshttps://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes
See all…https://developer.mozilla.org/en-US/docs/Web/HTML/Reference
Responsive imageshttps://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Responsive_images
HTML cheatsheethttps://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Cheatsheet
Date & time formatshttps://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Date_and_time_formats
See all…https://developer.mozilla.org/en-US/docs/Web/HTML/Guides
SVGhttps://developer.mozilla.org/en-US/docs/Web/SVG
MathMLhttps://developer.mozilla.org/en-US/docs/Web/MathML
XMLhttps://developer.mozilla.org/en-US/docs/Web/XML
CSS: Styling languagehttps://developer.mozilla.org/en-US/docs/Web/CSS
Propertieshttps://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties
Selectorshttps://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors
At-ruleshttps://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules
Valueshttps://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values
See all…https://developer.mozilla.org/en-US/docs/Web/CSS/Reference
Box modelhttps://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Box_model/Introduction
Animationshttps://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Animations/Using
Flexboxhttps://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Flexible_box_layout/Basic_concepts
Colorshttps://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Colors/Applying_color
See all…https://developer.mozilla.org/en-US/docs/Web/CSS/Guides
Column layoutshttps://developer.mozilla.org/en-US/docs/Web/CSS/How_to/Layout_cookbook/Column_layouts
Centering an elementhttps://developer.mozilla.org/en-US/docs/Web/CSS/How_to/Layout_cookbook/Center_an_element
Card componenthttps://developer.mozilla.org/en-US/docs/Web/CSS/How_to/Layout_cookbook/Card
See all…https://developer.mozilla.org/en-US/docs/Web/CSS/How_to/Layout_cookbook
JavaScript: Scripting languagehttps://developer.mozilla.org/en-US/docs/Web/JavaScript
Standard built-in objectshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
Expressions & operatorshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators
Statements & declarationshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements
Functionshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions
See all…https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
Control flow & error handlinghttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling
Loops and iterationhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration
Working with objectshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_objects
Using classeshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_classes
See all…https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide
Web APIs: Programming interfaceshttps://developer.mozilla.org/en-US/docs/Web/API
File system APIhttps://developer.mozilla.org/en-US/docs/Web/API/File_System_API
Fetch APIhttps://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
Geolocation APIhttps://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API
HTML DOM APIhttps://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API
Push APIhttps://developer.mozilla.org/en-US/docs/Web/API/Push_API
Service worker APIhttps://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
See all…https://developer.mozilla.org/en-US/docs/Web/API
Using the Web animation APIhttps://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Using_the_Web_Animations_API
Using the Fetch APIhttps://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
Working with the History APIhttps://developer.mozilla.org/en-US/docs/Web/API/History_API/Working_with_the_History_API
Using the Web speech APIhttps://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API
Using web workershttps://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
All web technologyhttps://developer.mozilla.org/en-US/docs/Web
Accessibilityhttps://developer.mozilla.org/en-US/docs/Web/Accessibility
HTTPhttps://developer.mozilla.org/en-US/docs/Web/HTTP
URIhttps://developer.mozilla.org/en-US/docs/Web/URI
Web extensionshttps://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions
WebAssemblyhttps://developer.mozilla.org/en-US/docs/WebAssembly
WebDriverhttps://developer.mozilla.org/en-US/docs/Web/WebDriver
See all…https://developer.mozilla.org/en-US/docs/Web
Mediahttps://developer.mozilla.org/en-US/docs/Web/Media
Performancehttps://developer.mozilla.org/en-US/docs/Web/Performance
Privacyhttps://developer.mozilla.org/en-US/docs/Web/Privacy
Securityhttps://developer.mozilla.org/en-US/docs/Web/Security
Progressive web appshttps://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps
Learn web developmenthttps://developer.mozilla.org/en-US/docs/Learn_web_development
Getting started moduleshttps://developer.mozilla.org/en-US/docs/Learn_web_development/Getting_started
Core moduleshttps://developer.mozilla.org/en-US/docs/Learn_web_development/Core
MDN Curriculumhttps://developer.mozilla.org/en-US/curriculum/
Check out the video course from Scrimba, our partnerhttps://scrimba.com/frontend-path-c0j?via=mdn-learn-navbar
Structuring content with HTML modulehttps://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Structuring_content
CSS styling basics modulehttps://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics
CSS layout modulehttps://developer.mozilla.org/en-US/docs/Learn_web_development/Core/CSS_layout
Dynamic scripting with JavaScript modulehttps://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Scripting
Playgroundhttps://developer.mozilla.org/en-US/play
HTTP Observatoryhttps://developer.mozilla.org/en-US/observatory
Border-image generatorhttps://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Backgrounds_and_borders/Border-image_generator
Border-radius generatorhttps://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Backgrounds_and_borders/Border-radius_generator
Box-shadow generatorhttps://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Backgrounds_and_borders/Box-shadow_generator
Color format converterhttps://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Colors/Color_format_converter
Color mixerhttps://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Colors/Color_mixer
Shape generatorhttps://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Shapes/Shape_generator
About MDNhttps://developer.mozilla.org/en-US/about
Advertise with ushttps://developer.mozilla.org/en-US/advertising
Communityhttps://developer.mozilla.org/en-US/community
MDN on GitHubhttps://github.com/mdn
Bloghttps://developer.mozilla.org/en-US/blog/
Webhttps://developer.mozilla.org/en-US/docs/Web
JavaScripthttps://developer.mozilla.org/en-US/docs/Web/JavaScript
Referencehttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
Expressions and operatorshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators
thishttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
https://github.com/orgs/mdn/discussions/739
https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Operators/this
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Operators/this
https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Operators/this
https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/this
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/this
https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Operators/this
https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Operators/this
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/this
https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Operators/this
See full compatibility https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#browser_compatibility
Learn more https://developer.mozilla.org/en-US/docs/Glossary/Baseline/Compatibility
bindinghttps://developer.mozilla.org/en-US/docs/Glossary/Binding
global objecthttps://developer.mozilla.org/en-US/docs/Glossary/Global_object
strict modehttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
Function.prototype.bind()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
Function.prototype.apply()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply
Function.prototype.call()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call
Arrow functionshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
Try ithttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#try_it
Syntaxhttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#syntax
Descriptionhttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#description
Exampleshttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#examples
Specificationshttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#specifications
Browser compatibilityhttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#browser_compatibility
See alsohttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#see_also
Try ithttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#try_it
Syntaxhttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#syntax
Valuehttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#value
Descriptionhttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#description
Function contexthttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#function_context
prototype chainhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Inheritance_and_the_prototype_chain
this substitutionhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode#no_this_substitution
globalThishttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
Function.prototype.call()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call
Function.prototype.apply()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply
Reflect.apply()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/apply
Function.prototype.bind()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
globalThishttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
iterative array methodshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#iterative_methods
Promise()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise
Set.prototype.forEach()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach
JSON.parse()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
JSON.stringify()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
arrow functionshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
global contexthttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context
closurehttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Closures
See example belowhttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#this_in_arrow_functions
newhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new
super referencehttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/super#calling_methods_from_super
Class contexthttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#class_context
classhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
Constructorshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor
publichttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields
privatehttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_elements
Statichttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static
static initialization blockshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks
function constructorshttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#constructors
bound to the instance for instance fields and to the class for static fieldshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions#cannot_be_used_as_methods
super()https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/super
Global contexthttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#global_context
blockshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/block
arrow functionshttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#arrow_functions
callbackshttps://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/this#callbacks
globalThishttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis