-
Notifications
You must be signed in to change notification settings - Fork 0
Object
-
Concat more Objects in a single Object.git tag
Object().concatElements([{key1:'value1'},{key2:'value2'},{key3:'value3'}])
result
{key1:"value1",key2:"value2",key3:"value3"}
-
Generate Objects from an array
Object().generator(["key1","value1","key2",{subkey1:"subvalue1",subkey2:"subvalue2"},"key3",["subvalue1","subvalue2"]])
result
{key1:"value1",key2:{subkey1:"subvalue1",subkey2:"subvalue2"},key3:["subvalue1","subvalue2"]}
-
Count elements
var a = {key1:"value1",key2:"value2",key3:"value3",key4:"value4",key5:"value5"};
a.length()
result
5
-
Split element in an array of single elements
var a = {key1:"value1",key2:"value2",key3:"value3"};
a.splitElements()
result
[{key1:'value1'},{key2:'value2'},{key3:'value3'}]
-
Generate an array with object values
var o = {key1:"value1",key2:{subkey1:"subvalue1",subkey2:"subvalue2"},key3:["subvalue1","subvalue2"]};
o.toArray();
result
["value1",{subkey1:"subvalue1",subkey2:"subvalue2"},["subvalue1","subvalue2"]]
-
Get specific values (only accept an ARRAY as search params)
var o = {key1:"value1",key2:{subkey1:"subvalue1",subkey2:"subvalue2"},key3:["subvalue1","subvalue2"]};
o.getValues(["key1","key3"]);
result
["value1",["subvalue1","subvalue2"]]