GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
JE::Object::Array(3) User Contributed Perl Documentation JE::Object::Array(3)

JE::Object - JavaScript Array object class

  use JE;
  use JE::Object::Array;

  $j = new JE;

  $js_array = new JE::Object::Array $j, 1, 2, 3;

  $perl_arrayref = $js_array->value; # returns [1, 2, 3]

  $js_array->[1]; # same as $js_array->value->[1]

  "$js_array"; # returns "1,2,3"

This module implements JavaScript Array objects.

The "@{}" (array ref) operator is overloaded and returns a tied array that you can use to modify the array object itself. The limitations and caveats mentioned in "JE::Object/"USING AN OBJECT AS A HASH"" apply here, too.

See JE::Types for descriptions of most of the methods. Only what is specific to JE::Object::Array is explained here.
$a = JE::Object::Array->new($global_obj, \@elements)
$a = JE::Object::Array->new($global_obj, $length)
$a = JE::Object::Array->new($global_obj, @elements)
This creates a new Array object.

If the second argument is an unblessed array ref, the elements of that array become the elements of the new array object.

If there are two arguments and the second is a JE::Number, a new array is created with that number as the length.

Otherwise, all arguments starting from the second one become elements of the new array object.

$a->value
This returns a reference to an array. This is a copy of the Array object's internal array. If you want an array through which you can modify the object, use @$a.

JE

JE::Types

JE::Object

2014-10-20 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.