Sets the element at the zero-based index to the specified value. The `index` must refer to an element
which already exists in the array.
+### <a id="array-get"></a> Array#get
+
+Signature:
+
+ function get(index);
+
+Retrieves the element at the specified zero-based index.
+
### <a id="array-sort"></a> Array#sort
Signature:
Creates or updates an item with the specified `key` and `value`.
+### <a id="dictionary-get"></a> Dictionary#get
+
+Signature:
+
+ function get(key);
+
+Retrieves the value for the specified `key`. Returns `null` if they `key` does not exist
+in the dictionary.
+
## <a id="scriptfunction-type"></a> Function type
### <a id="scriptfunction-call"></a> Function#call
self->Set(index, value);
}
+static Value ArrayGet(int index)
+{
+ ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
+ Array::Ptr self = static_cast<Array::Ptr>(vframe->Self);
+ return self->Get(index);
+}
+
static void ArrayAdd(const Value& value)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
prototype = new Dictionary();
prototype->Set("len", new Function(WrapFunction(ArrayLen), true));
prototype->Set("set", new Function(WrapFunction(ArraySet)));
+ prototype->Set("get", new Function(WrapFunction(ArrayGet)));
prototype->Set("add", new Function(WrapFunction(ArrayAdd)));
prototype->Set("remove", new Function(WrapFunction(ArrayRemove)));
prototype->Set("contains", new Function(WrapFunction(ArrayContains), true));
self->Set(key, value);
}
+static Value DictionaryGet(const String& key)
+{
+ ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
+ Dictionary::Ptr self = static_cast<Dictionary::Ptr>(vframe->Self);
+ return self->Get(key);
+}
+
static void DictionaryRemove(const String& key)
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
prototype = new Dictionary();
prototype->Set("len", new Function(WrapFunction(DictionaryLen), true));
prototype->Set("set", new Function(WrapFunction(DictionarySet)));
+ prototype->Set("get", new Function(WrapFunction(DictionaryGet)));
prototype->Set("remove", new Function(WrapFunction(DictionaryRemove)));
prototype->Set("contains", new Function(WrapFunction(DictionaryContains), true));
prototype->Set("clone", new Function(WrapFunction(DictionaryClone), true));