JSFiddle

  • Practice Set, Week 14, Drawing on the Canvas

    jQuery 1.11.0, HTML, CSS, JavaScript

    // get the canvas and context objects
    var canvas = document.getElementById("c1");
    var ctx = canvas.getContext('2d');
    
    // get the image object ...
  • Practice Set, Week 14, Drawing Lines on the Canvas

    jQuery 1.11.0, HTML, CSS, JavaScript

    // get the canvas and context objects
    var canvas = document.getElementById("c1");
    var ctx = canvas.getContext('2d');
    
    // We can draw on ...
  • Practice Set, Week 8, DOM Traversal

    No-Library (pure JS), HTML, CSS, JavaScript

    function traverse(el, str) {
        // Your code can go here - acting on the way down 
        //   the tree towards the branches
        
        
        for ...
  • Practice Set, Week 10, Iterate over a form's fields #1 is the latest revision

    No-Library (pure JS), HTML, CSS, JavaScript

    /* Write your code here to iterate over the form's fields and output the   values in each field to the ...
  • Try Catch Throw

    Easy Programming tutorial on how to throw custom errors in JavaScript

    var button = document.getElementById("button");
    
    button.addEventListener("click",function(e){
    try {
    		var num = document.getElementById("num").value;
        
        if(num < 0){
        	throw("Number is too low, try again");
        }
        if(num > 10 ...
  • Try Catch Finally

    Learn better error handling from this EasyProgramming.net tutorial

    var a = 5;
    var b = 10;
    try{
    	document.getElementById('output').innerText = a * b;
    } catch (e) {
    	document.getElementById('output').innerText = 'There ...
  • JSON.parse() and JSON.stringify

    How to use JSON.parse() and JSON.stringify() by EasyProgramming.net

    var person = {
    		name: 'Nazmus',
        city: 'Boston',
        state: 'Massachusetts',
        website: 'EasyProgramming.net',
        language: 'JavaScript',
        job: 'Developer',
        hair: 'Black',
        eyes: 'Brown',
        hands ...
  • for...in with forEach()

    EasyProgramming.net tutorial on how to combine the for...in loop with for...each

    var person = function(name,city,state,website,language,job){
    		this.name = name,
        this.city = city,
        this.state = state,
        this.website ...
  • The for...in loop

    How to do the for...in loop to loop through object properties! Tutorial brought to you by EasyProgramming.net

    var person = {
    		name: 'Nazmus',
        city: 'Boston',
        state: 'Massachusetts',
        website: 'EasyProgramming.net',
        language: 'JavaScript',
        job: 'Developer',
        hair: 'Black',
        eyes: 'Brown',
        hands ...
  • Create Custom Methods in JS

    EasyProgramming.net tutorial on creating custom methods

    var phone = function(name, price, brand, model, os, colorF, colorB){
    		this.name = name,
        this.price = price,
    		this.brand = brand,
        this ...