Home >Web Front-end >JS Tutorial >Parsing invisible data types in JavaScript_javascript tips
JS provides some built-in objects, functions and constructors for us to program, such as Math, parseInt, Object, Array, etc. These are all visible and can be used during programming. For example, I can use new Object or new Array.
Some are invisible, and these objects can only be provided by the engine in special circumstances. These types of objects often have reduced functionality. Here are some
1. Arguments type
Arguments type cannot be created manually by programmers, that is, you cannot new Arguments(). It has and only one object arguments
2. The function returned by bind is very special
bind is a new method added to Function.prototype by ES5. It is called directly on function like call/apply. It returns a function with specified context and parameters.
Is it weird? Doesn't every function have a prototype attribute? This is used to implement prototype inheritance. Indeed, the function returned by bind is special, it does not have a prototype. This special function is created by the JS engine and cannot be directly measured by the client programmer through function declaration or function.
This is clearly stated in the specification ES5 15.3.4.5