JAVASCRIPT 1A – Some things about JavaScript

 

  • Variables do not have a type. Use var instead of float, int, double, long, char, String, Array, etc. You do not need to specify return types or parameter types for functions.
  • A var can be anything — any of the types mentioned, but also functions.
  • Arrays are constructed very simply (no need for Processing ArrayList anymore) and have many built-in features, see this array example and more about JS arrays here
  • JavaScript uses something called prototypes to form something similar to Java class objects. See this objects example and more about JS objects here.
  • For a tutorial on transitioning from Processing to p5.js which is javascript see here.