
1.4 Static Functions - The Nature of Code
In this video, I discuss the difference between static and instance functions in JavaScript and how they are used in the p5.Vector class. Code: https://thecodingtrain.com/tracks/the-nature-of-code-2/noc/1-vectors/4-static-functions
π Watch this video ad-free on Nebula https://nebula.tv/videos/the-coding-train-yt-1-4-static-functions-the-nature-of-code
π₯ Previous video: https://youtu.be/jupjuq9Jl-M?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
π₯ Next video: https://youtu.be/ttz05d8DSOs?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
References:
π Math.random(): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
π p5.Vector add Reference: https://p5js.org/reference/#/p5.Vector/add
Timestamps:
0:00 Introduction
1:14 Instance functions
2:00 Static functions
3:20 Name-spaced functions
4:30 Instance/Static versions of the same function
7:09 Using the static version of a function to store the result of an operation
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
π Website: http://thecodingtrain.com/
πΎ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
π© Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
π‘ GitHub: https://github.com/CodingTrain
π¬ Discord: https://thecodingtrain.com/discord
π Membership: http://youtube.com/thecodingtrain/join
π Store: https://standard.tv/codingtrain
ποΈ Twitter: https://twitter.com/thecodingtrain
πΈ Instagram: https://www.instagram.com/the.coding.train/
βͺ Nebula: https://go.nebula.tv/codingtrain
π₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π p5.js: https://p5js.org
π p5.js Web Editor: https://editor.p5js.org/
π Processing: https://processing.org
π Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#forbeginners #javascript #p5js