1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
4 \page qtqml-javascript-functionlist.html
5 \title List of JavaScript Objects and Functions
6 \brief A list of objects, functions, and properties supported in QML.
8 This reference contains a list of objects, functions and
9 properties supported by the \l{QJSEngine}{JavaScript engine} in Qt.
10 For a detailed description, see the \l{ECMA-262} specification.
12 \section1 The Global Object
14 \section2 Value Properties
22 \section2 Function Properties
26 \li parseInt(string, radix)
27 \li parseFloat(string)
30 \li decodeURI(encodedURI)
31 \li decodeURIComponent(encodedURIComponent)
33 \li encodeURIComponent(uriComponent)
38 \section2 Constructor Properties
67 \section2 Other Properties
77 \section1 The Object Object
79 \section2 Object Constructor
81 \section3 Function Properties
85 \li setPrototypeOf(O, P)
86 \li getOwnPropertyDescriptor(O, P)
87 \li getOwnPropertyDescriptors(O)
88 \li getOwnPropertyNames(O)
89 \li getOwnPropertySymbols(O)
90 \li assign(O [, Properties])
91 \li create(O [, Properties])
92 \li defineProperty(O, P, Attributes)
93 \li defineProperties(O, Properties)
102 \li preventExtensions(O)
106 \section2 Object Prototype
108 \section3 Function Properties
114 \li hasOwnProperty(V)
116 \li propertyIsEnumerable(V)
117 \li __defineGetter__(P, F)
118 \li __defineSetter__(P, F)
121 \section1 Function Objects
123 \section2 Function Prototype
125 \section3 Function Properties
129 \li apply(thisArg, argArray)
130 \li call(thisArg [, arg1 [, arg2, ...]])
131 \li bind((thisArg [, arg1 [, arg2, …]])
132 \li [Symbol.hasInstance](O)
135 \section1 Array Objects
137 \section2 Array Prototype Object
139 \section3 Function Properties
144 \li concat([item1 [, item2 [, ...]]])
145 \li copyWithin([item1 [, item2 [, ...]]])
147 \li fill(item [, index1 [, index2]])
149 \li find(callbackfn [, thisArg]) // ECMAScript 6: Added in Qt 5.9
150 \li findIndex(callbackfn [, thisArg]) // ECMAScript 6: Added in Qt 5.9
154 \li push([item1 [, item2 [, ...]]])
157 \li slice(start, end)
159 \li splice(start, deleteCount[, item1 [, item2 [, ...]]])
160 \li unshift([item1 [, item2 [, ...]]])
161 \li indexOf(searchElement [, fromIndex])
162 \li lastIndexOf(searchElement [, fromIndex])
163 \li every(callbackfn [, thisArg])
164 \li some(callbackfn [, thisArg])
165 \li forEach(callbackfn [, thisArg])
166 \li map(callbackfn [, thisArg])
167 \li filter(callbackfn [, thisArg])
168 \li reduce(callbackfn [, initialValue])
169 \li reduceRight(callbackfn [, initialValue])
171 \li [Symbol.iterator]()
174 \section1 String Objects
176 \section2 String Prototype Object
178 \section3 Function Properties
186 \li concat([string1 [, string2 [, ...]]])
187 \li endsWith(searchString [, endPosition ]) // ECMAScript 6: Added in Qt 5.8
188 \li includes(searchString [, position ]) // ECMAScript 6: Added in 5.8
189 \li indexOf(searchString ,position)
190 \li lastIndexOf(searchString, position)
191 \li localeCompare(that)
194 \li padEnd(length [, string])
195 \li padStart(length [, string])
196 \li repeat(count) // ECMAScript 6: Added in Qt 5.9
197 \li replace(searchValue, replaceValue)
199 \li slice(start, end)
200 \li split(separator, limit)
201 \li startsWith(searchString [, position ]) // ECMAScript 6: Added in Qt 5.8
202 \li substr(start, length)
203 \li substring(start, end)
205 \li toLocaleLowerCase()
207 \li toLocaleUpperCase()
209 \li [Symbol.iterator]()
212 Additionally, the QML engine adds the following functions to the \c String prototype:
214 \li \l {string}{string::arg()}
218 \section1 Boolean Objects
220 \section2 Boolean Prototype Object
222 \section3 Function Properties
229 \section1 Number Objects
231 \section2 Number Prototype Object
233 \section3 Function Properties
239 \li toFixed(fractionDigits)
240 \li toExponential(fractionDigits)
241 \li toPrecision(precision)
244 Additionally, the QML engine adds the following functions to the \l Number prototype:
246 \li \l {Number::fromLocaleString}{fromLocaleString(locale, number)}
247 \li \l {Number::toLocaleCurrencyString}{toLocaleCurrencyString(locale, symbol)}
248 \li \l {Number::toLocaleString}{toLocaleString(locale, format, precision)}
251 \section2 The Number Object
253 \section3 Value Properties
257 \li NEGATIVE_INFINITY
258 \li POSITIVE_INFINITY
261 \li EPSILON // ECMAScript 6: Added in Qt 5.8
266 \section3 Function Properties
269 \li isFinite(x) // ECMAScript 6: Added in Qt 5.8
272 \li isNaN(x) // ECMAScript 6: Added in Qt 5.8
275 \section1 The Math Object
277 \section2 Value Properties
290 \section2 Function Properties
316 \li max([value1 [, value2 [, ...]]])
317 \li min([value1 [, value2 [, ...]]])
321 \li sign(x) // ECMAScript 6: Added in Qt 5.8
330 \section1 Date Objects
332 \section2 Date Prototype Object
334 \section3 Function Properties
341 \li toLocaleDateString()
342 \li toLocaleTimeString()
359 \li getMilliseconds()
360 \li getUTCMilliseconds()
361 \li getTimeZoneOffset()
363 \li setMilliseconds(ms)
364 \li setUTCMilliseconds(ms)
365 \li setSeconds(sec [, ms])
366 \li setUTCSeconds(sec [, ms])
367 \li setMinutes(min [, sec [, ms]])
368 \li setUTCMinutes(min [, sec [, ms]])
369 \li setHours(hour [, min [, sec [, ms]]])
370 \li setUTCHours(hour [, min [, sec [, ms]]])
373 \li setMonth(month [, date])
374 \li setUTCMonth(month [, date])
376 \li setFullYear(year [, month [, date]])
377 \li setUTCFullYear(year [, month [, date]])
382 \li [Symbol.toPrimitive](hint)
385 Additionally, the QML engine adds the following functions to the \l Date prototype:
387 \li \l {Date::timeZoneUpdated}{timeZoneUpdated()}
388 \li \l {Date::toLocaleDateString}{toLocaleDateString(locale, format)}
389 \li \l {Date::toLocaleString}{toLocaleString(locale, format)}
390 \li \l {Date::toLocaleTimeString}{toLocaleTimeString(locale, format)}
393 \section1 RegExp Objects
395 \section2 RegExp Prototype Object
397 \section3 Function Properties
405 \section1 Error Objects
407 \section2 Error Prototype Object
409 \section3 Value Properties
416 \section3 Function Properties
422 \section1 The JSON Object
424 \section2 Function Properties
427 \li parse(text [, reviver])
428 \li stringify(value [, replacer [, space]])