JavaScript Coding Styles

RAMP-TS

JavaScript Coding Styles

In coding RAMP-TS scripts in JavaScript these code fragments are all standard and equivalent:

 

x = new Object();

x.a = 1;

x.b = "Hello"; 

  

-----------------------------------------

  

x = { a : 1, b : "Hello" ) 

  

-----------------------------------------

  

x = { "a" : 1, "b" : "hello" }   <========= which is the JavaScript format that was chosen for use in AJAX-JSON strings.   

  

-----------------------------------------

  

x = { };

x["a"] = 1;

x["b"] = "hello";

  

-----------------------------------------

  

x = new Object();

x["a"] = 1;

x["b"] = "hello";

  

-----------------------------------------