Writing function in JavaScript

Let us create a function called cool and call it immediately and then we shall create the same function with small change in console message as follows. function cool(){ console.log('first function'); } cool(); function cool(){ console.log('second function'); } cool(); When we execute the above JavaScript code, we will get the output as second function second…

%d bloggers like this: