// basically init function
function functionName() {
// some code
}
// ES6 init function
const function_name = () =>{
// some code
}
// init function as method in object
const object = {
function_name : function() {
// some code
}
}
// to use function
function_name();
object.function_name();
// immediately run function
((sum_var)=>{
console.log(sum_var);
//some code
})();
// immediately run async function
(async (sum_var)=>{
await something();
//some code
})();