Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/opal/json.rb
Instance Method Summary collapse
Instance Method Details
#to_json ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/opal/json.rb', line 106 def to_json %x{ var result = []; for (var i = 0, length = this.length; i < length; i++) { result.push(#{`this[i]`.to_json}); } return '[' + result.join(', ') + ']'; } end |