return vs console.log
- New developers often get confused between
returnandconsole.log returntells the caller function the result of a function- Useful when you want to use the result of a calculation
console.logmakes a logging record of a message- Useful for debugging and seeing if something happened
- Only useful to a developer. Not visible to a normal user
15 / 24