Javascript Literals

  • Function Literals
    var squares = function(x){ return x*x; }var square = new Function("x", "return x*x;");

  • Object Literals
    var point = {x:2.3, y:-1.2};?? var point = new Object({x:2.3, y:-1.2});

  • Array Literals
    var a = [1.2, "Javascript", true, {x:1, y:3}];var a = new Array(1.2, "Javascript", true, {x:1, y:3});

0 Responses to “Javascript Literals”



  1. No Comments Yet

Leave a Reply

You must login to post a comment.