NA +91-8727899942 thecoderjob@gmail.com

CHAPTER - 6

Behavior of this keyword in javascript.

the this keyword refers to the current execution context,

and its behavior depends on how a function is called.

The value of this is determined at runtime and is not static.

Here's is the Code !!

// Neel.B
const normalFunction = () => {
	console.log(this)
}	
const normalObject = {
	name : "Neel",
	privateInfo1 : function(){
		console.log(this)
	},
	privateInfo2 : () => {
		console.log(this)
	}
}
normalFunction() // Output : window object
normalObject.privateInfo1() // Output : refer to normalObject
normalObject.privateInfo2() // Output : window object

Chapter 5

What is IIFE function in javascript?

Previous chapter

Chapter 7

Reverse a string in javascript.

Next chapter

Get In Touch

NA

thecoderjob@gmail.com

+91-8727899942

Popular Links

© www.thecoderjob.com. All Rights Reserved.               Designed by HTML Codex