Beyond Code Live X: Functions in Modern Languages (using JavaScript as an example)
Powered by Restream
https://restream.io/In essence, you can think of a function as a manufacturing process that has several steps. If you had a factory that created cars, the machines would follow the same process every time, which little or no variation, and would produce a unique result.
For example, if you call the process twice, and the process is correct, you would get two distinct cars - you would destroy the first car to create the second, nor would you mix the two together.
These seems obvious in the physical world, but sometimes in the digital world we forget that.
And sometimes... well, not all programs are correct.
function create(color, gearbox) {
if (!color) {
color = 'black';
}
if (!gearbox) {
gearbox = 'automatic';
}
var car = {
make: 'Honda',
model: 'Civic',
color: color,
gearbox: gearbox
};
return car;
}
Beyond Code:
(Learn to Code in 15 Minutes a Day)
Bootcamp Playlist:
https://www.youtube.com/playlist?list=PLxki0D-ilnqZfyo2dZe11ZNGP7RJxJcoASubscribe on YouTube:
https://youtube.com/channel/UC2KJHARTj6KRpKzLU1sVxBAJoin on Facebook:
https://fb.com/beyondcodebootcampFollow on Twitter:
https://twitter.com/@_beyondcodeAJ's Live Streams:
Watch on Twitch:
https://twitch.tv/coolaj86Subscribe on YouTube:
https://youtube.com/coolaj86Watch on Facebook:
https://fb.com/coolaj86Health, Wealth, Commitment
(My Morning Shower Thoughts as a Daily Lifestyle Vlog)
Join on Facebook:
https://www.facebook.com/groups/5406824179391158Subscribe on YouTube:
https://www.youtube.com/channel/UCbw2SbqD0OofAEVF_T61wCQ#softwaredevelopment #softwareengineer #webdevelopment #webdeveloper
...
https://www.youtube.com/watch?v=bddSi89OPIw