Open main menu

CDOT Wiki β

Changes

User:Dhhodgin

211 bytes added, 21:55, 18 October 2009
shorten()
Here is a list of code blocks I have written for the processing.js project
==== shorten() ====
Arrays in JS have no type the elements in them can contain any type and do not all have to match. Arrays are also passed by reference which means a reference to the object is passed in not the entire object. so my code creates a new array and then copies the passed in array first and then pops one element off the original array and the newary is returned array . This is put into newary build to accept a processing type of String, int, boolean, char, byte, and returnedfloat.
p.shorten = function( ary ) {
return newary;
}
 
Example of this function and test is [http://matrix.senecac.on.ca/~dhhodgin/dps909/processing.html here].
== Week 1 stuff ==
1
edit