Number.parseInt: parsing an integer prefix
Number.parseInt converts its argument to text and returns the integer from the longest valid prefix in the selected radix, or NaN.
CKTIS / JavaScript
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Number.parseInt converts its argument to text and returns the integer from the longest valid prefix in the selected radix, or NaN.
Number.POSITIVE_INFINITY is the Number value +∞, equal to global Infinity and greater than every finite number.
toExponential returns exponential text with one digit before the decimal point and a requested number of digits after it.
toFixed returns fixed-point text with exactly the requested number of digits after the decimal point.
toPrecision returns text with the requested number of significant digits, choosing fixed or exponential notation.
Object.assign copies enumerable own property values from sources into one target object.
Object.create makes an ordinary object with exactly the specified prototype and optional own-property descriptors.
Object.defineProperties defines several properties with full descriptors after collecting and validating the whole descriptor map.
Object.defineProperty defines or changes one own property using an explicit data or accessor descriptor.
Object.entries returns a new array of pairs for enumerable own properties whose keys are strings.
Object.freeze prevents extension and reconfiguration of an object’s own properties and makes its own data properties non-writable.
Object.fromEntries creates a new object from an iterable collection of key–value entries. It supports string and symbol keys; repeated keys keep the last value. Use it to transform entries or convert a Map into an object.
Object.getOwnPropertyDescriptor returns a description of an object's own property: its value or accessors and its attribute flags. It skips the prototype chain and returns undefined when the object has no such own property.
For an ordinary object, Object.getOwnPropertyDescriptors returns descriptors for all its own properties, including non-enumerable and Symbol-keyed properties. Use it to inspect attributes or copy properties without turning accessors into values.
Object.getOwnPropertyNames(obj) returns a new array of string keys. For ordinary objects, these are the keys of all own properties with string keys, including non-enumerable ones. Symbol keys are excluded, and a Proxy's ownKeys trap can affect the list.
Object.getOwnPropertySymbols(obj) returns an array of Symbol keys. For ordinary objects, these are the keys of own properties, including non-enumerable ones. The method excludes string keys and does not traverse the prototype chain.
Object.getPrototypeOf returns an object’s current immediate prototype, or null for an object with no prototype.
Object.groupBy iterates an iterable, calls a callback for every element, and returns a null-prototype object of group arrays.
Object.hasOwn returns true when a key is an object’s own property, regardless of that property’s value or enumerability.
Object.is compares two values without coercion, treating NaN as equal to itself and distinguishing +0 from -0.
Object.isExtensible returns a boolean indicating whether new own properties can still be added to an object.
Object.isFrozen(value) checks whether an object is non-extensible, its own properties are non-configurable, and its data properties are also non-writable. It neither freezes the object nor recursively checks nested objects.
Object.isSealed(value) checks whether an object is non-extensible and all its own properties are non-configurable. This does not imply immutable values or sealed nested objects.
Object.keys(obj) returns a new array of an object's own enumerable string keys. It excludes inherited properties, non-enumerable properties, and Symbol keys. For ordinary objects, array-index keys appear before the remaining string keys.