Skip to content

Instantly share code, notes, and snippets.

@DmitryMasley
Created February 13, 2020 10:10
Show Gist options
  • Save DmitryMasley/4efbdffe182c0431cd003d69c44e5ebf to your computer and use it in GitHub Desktop.
Save DmitryMasley/4efbdffe182c0431cd003d69c44e5ebf to your computer and use it in GitHub Desktop.
const index = 1;
((arg) => { arg++ })(index);
console.log(`Index: ${index}`);
const str = "a";
((arg) => { arg.toUpperCase() })(str)
console.log(`String: ${str}`);
const obj = { index: 1, str: "a" };
((arg) => { arg.index++; arg.str.toUpperCase(); })(obj);
console.log(`Object ${JSON.stringify(obj)}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment