Here are some links from Nature of Code today about using Processing.js to write directly with Javascript:
complete example of an html page using processing.js
The same as above but in JSFiddle
Other Libraries
Tutorials and Syllabuses for learning Javascript