Return Statement Simplified
22nd July, 2019
I usually have issues with this statement and as I was able to have a grasp of it, I decided to write about it.
The return statement is a statement that evaluates a value and attaches it to a function. When such functions are called, they return the value that was evaluated.
Take a look at this example,
let a = 5; let b = 5; let c = a + b; console.log('a: ' + a + ', b: ' + b + ', c: ' + c); //Output //a: 5, b: 5; c: 10