Premium Only Content

call() method in JavaScript ( #shorts )
Hi Friends,
call() method in JavaScript
In JavaScript, `call()` method is used to call a function with a specific `this` value and argument
eg: There is a object `Human` with `name` property & function `welcome()` that will show a welcome message with name of Human. `call()` is use to set the `this` value of `welcome()` to the `Human` object & pass the `name` property as an argument.
const human = {
name: "David",
welcome: function(message) {
console.log(`${message}, ${this.name}!`);
}
};
human.welcome("Hello"); // Output: Hello, David!
// Using call() to call wekcome() with a different message and this value
human.welcome.call({ name: "Sarah" }, "Hi"); // Output: Hi, Sarah!
Using `call()` allows us to reuse the `welcome()` function for different objects and control the `this` value and arguments passed to it.
#javascript #call #callmethod #string #javascriptinterview #method #js #jquery #function #shorts #viral #popular #latest #new #famous #coders #development #code #dev #interview #php #trend #trending #answer #youtube #instagram #socialmedia #education #edit #gaming #how #india #knowledge #love #like #motivational #quiz #reels #short #subscribe #share #update #video #web #webdeveloper #website #webdesign #ytshorts #youtuber #princecheema_official @princecheema_official
-
LIVE
TheCrucible
37 minutes agoThe Extravaganza! EP: 31 (9/03/25
15,512 watching -
LIVE
Kim Iversen
48 minutes agoEPSTEIN VICTIM: We Have The Names. We'll Make The List.
723 watching -
LIVE
Redacted News
1 hour agoBREAKING! Putin's DEVASTATING news for Europe | Secret UFO Space Base in Huntsville | Redacted Live
12,210 watching -
1:17:49
vivafrei
3 hours agoEpstein Press Conference DEBACLE! Missing Minute FOUND? Canada Continues to Fall! & MORE!
63.6K29 -
29:30
Stephen Gardner
1 hour ago🟢YES! Trump’s Doing It! Ben Shapiro UNLEASHES on Democrat STUPIDITY!
4.78K3 -
LIVE
Dr Disrespect
5 hours ago🔴LIVE - DR DISRESPECT - METAL EDEN - NEW 2025 SCI-FI FPS LAUNCH STREAM
1,191 watching -
LIVE
StoneMountain64
3 hours agoBattlefield's Easter Egg Phantom Project is STILL ALIVE
182 watching -
LIVE
LFA TV
10 hours agoLFA TV ALL DAY STREAM - WEDNESDAY 9/3/25
1,663 watching -
LIVE
freecastle
6 hours agoTAKE UP YOUR CROSS- Love...Light...TRUTH!
174 watching -
1:50:29
The Quartering
3 hours agoEpstein Victims To NAME People, Mutiny Over RFK Jr, Trump Turns On Warp Speed?
120K36