Home
/
Reference
/
Methods
Built-in Object Methods
Djazair allows calling methods directly on primitive arrays, maps, and strings using standard dot syntax.
String Methods
| Method | Description |
length() | Character count |
upper() | Uppercase conversion |
lower() | Lowercase conversion |
strip() | Trim whitespace both ends |
lStrip() | Trim whitespace from left |
rStrip() | Trim whitespace from right |
contains(substr) | Check if substring exists |
find(substr) | Return index of substring (alias for index) |
count(substr) | Count occurrences |
index(needle) | First index (-1 if not found) |
split(sep?) | Split into array (default: whitespace) |
join(list) | Join array using string as separator |
slice(start, end?) | Extract substring |
subStr(start, len?) | Extract by start and length |
replace(old, new) | Replace all |
reverse() | Reverse string in-place |
reversed() | Return reversed string copy |
repeat(n) | Repeat n times |
zFill(width) | Zero-pad to given width |
center(width) | Center string in field of given width |
lJust(width) | Left-justify in field of given width |
rJust(width) | Right-justify in field of given width |
startsWith(prefix) | Check prefix |
endsWith(suffix) | Check suffix |
capitalize() | First char uppercase |
title() | Title case |
swapCase() | Swap uppercase/lowercase |
charCodeAt(i) | Character code at index |
isAlpha() | Check if alphabetic |
isAlnum() | Check if alphanumeric |
isDigit() | Check if digit |
isLower() | Check if lowercase |
isUpper() | Check if uppercase |
isSpace() | Check if whitespace |
concat(...) | Concatenate multiple strings |
Array Methods
| Method | Description |
length() | Number of elements |
append(v) | Add at end |
pop(index?) | Remove and return last element (or at index) |
insert(i, v) | Insert at index |
remove(v) | Remove first occurrence of value |
reverse() | Reverse array in-place |
reversed() | Return reversed copy (original unchanged) |
index(val|cb) | Index of value or first element matching callback (-1 if not found) |
extend(arr) | Append all elements from another array |
sort(desc?) | Sort in-place |
sorted(desc?) | Return sorted copy (original unchanged) |
copy() | Shallow copy |
clear() | Remove all elements |
contains(v) | Check membership |
count(v) | Count occurrences of value |
concat(other) | Merge arrays |
slice(s, e?) | Extract sub-array |
join(sep) | Join elements into string with separator |
flatten() | Flatten one level |
unique() | Remove duplicate values |
all() | All elements are truthy |
any() | Any element is truthy |
min() | Minimum value |
max() | Maximum value |
sum() | Sum of numeric elements |
map(fn) | Transform each element |
filter(fn) | Keep elements where callback returns truthy |
reduce(fn, init) | Accumulate using callback |
find(val) | Find first element matching value or callback (Null if not found) |
every(fn) | All elements pass callback |
some(fn) | Any element passes callback |
Map Methods
| Method | Description |
length() | Number of entries |
keys() | Array of keys |
values() | Array of values |
items() | Array of [key, value] pairs |
has(key) | Check key existence |
get(key) | Get value (Null if missing) |
copy() | Shallow copy |
clear() | Remove all entries |
pop(key) | Remove and return value |
setDefault(k, v) | Set only if key missing |
update(other) | Merge entries from another map |