-
-
Save navanathjadhav/a9fbb4dabe5a545b8ec412fe2a8e3cdf to your computer and use it in GitHub Desktop.
Example of using stack memory efficiently
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This will invoke showGreetMessage method and pass only required field | |
*/ | |
function Greet() { | |
const greetObject = { | |
message: "Hello & Welcome to Ever Blogs", | |
alignment: "Top", | |
color: "black", | |
}; | |
const { message } = greetObject; | |
showGreetMessage(message); | |
} | |
/* | |
* This method will be invoked and it takes message variable as argument | |
* Instead of taking whole greet object in argument, we take only message field | |
*/ | |
function showGreetMessage(message) { | |
alert(message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment