toJSON :: Object

toJSON() -> String

 

Returns a JSON string.

 

 

Examples

 

var data = {name: 'Violet', occupation: 'character', age: 25, pets: ['frog''rabbit']};

Object.toJSON(data);

 

//-> '{"name":"Violet","occupation":"character","age":25,"pets":["frog","rabbit"]}'

 

 

 


Prototype API 1.5.0 - prototypejs.org