class Array

Public Instance Methods

to_js() click to toggle source

Convert Ruby array to JavaScript array

# File packages/gems/js/lib/js/array.rb, line 3
def to_js
  new_array = JS.eval("return []")
  # NOTE: This method call implicitly convert element to JS object by to_js
  new_array.push *self
  new_array
end