Skip to content

Instantly share code, notes, and snippets.

@navanathjadhav
Created Jun 17, 2022
Embed
What would you like to do?
Example of using stack memory efficiently
/*
* 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