❤ Benefits

Primitive wrapper object of Number

Some objects are based on primitive wrapper objects, and below is a list containing some pros of using them and important design benefits.

Immutability

Immutable primitive value of primitive wrapper objects.

The exact type

Specific functionality objects with generic type variables(which preserves exact type) act as precise types.

Object as types

Objects have the Symbol.toStringTag changed to unique immutable names.

Type of the objects can be determined by the Object.prototype.toString.call(). because of its uniqueness and immutability.

There is prepared function typeOf() function of @angular-package/type to determine these objects type.

Functionality follows the type

The most important functionalities for a specific name.

Objects have functionalities that use primitive values.

Intuitiveness

General and intuitive object names.

Intuitive names of generic type variables.

Intuitive accessor and property names.

Intuitive method names.

Minimalism and simplicity

Minimal, simple to use and an ease-extendable objects.

Functionality

Greater

Checks whether the primitive value is greater than the given value.

Checks whether the primitive value is greater than every of the given values.

Checks whether the primitive value is greater than some given values.

Less

Checks whether the primitive value is less than the given value.

Checks whether the primitive value is less than every of the given values.

Checks whether the primitive value is less than some given values.

Inequality

Functionality of both the Greater and Less objects.

Checks the primitive value whether it is between the given range of the minimum and maximum.

Checks the primitive value whether it is between every value of the given ranges.

Checks the primitive value whether it is between some given values.

Maximum

Functionality of the Inequality abstract object.

Indicates the maximum value.

Minimum

Functionality of the Inequality abstract object.

Indicates the minimum value.

Range

Indicates the range of minimum and maximum with the value and step.

The range value gives the current range.

Updates current range by specified steps down/up, or exact to the step.

Checks whether range of the given minimum and maximum is between the range of a specified Range object.

Checks whether the range of a specified Range object is between every range of the given ranges.

Checks whether the range of a specified Range object is between some given ranges.

Last updated