function function_name(){
//function body
console.log("my function")
}
//ES6
const function_name = ()=>{
//function body
console.log("my ES6 function")
}
//you can call both functions like this
function_name()
// 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
})();