0

i am learning javascript, and thougth it would be cool to know how things actually work behind the scenes.

I actually gone to the the console and typed

console.log(Promise);

but this is what it returned.

all: ƒ all()
arguments: (...)
caller: (...)
length: 1
name: "all"
[[Prototype]]: ƒ ()
[[Scopes]]: Scopes[0]
allSettled: ƒ allSettled()
arguments: (...)
caller: (...)
length: 1
name: "allSettled"
[[Prototype]]: ƒ ()
apply: ƒ apply()
arguments: (...)
bind: ƒ bind()
call: ƒ call()
caller: (...)
constructor: ƒ Function()
length: 0
name: ""
toString: ƒ toString()
Symbol(Symbol.hasInstance): ƒ [Symbol.hasInstance]()
get arguments: ƒ ()
set arguments: ƒ ()
get caller: ƒ ()
set caller: ƒ ()
[[FunctionLocation]]: ​
[[Prototype]]: Object
[[Scopes]]: Scopes[0]
[[Scopes]]: Scopes[0]
any: ƒ any()
arguments: (...)
caller: (...)
length: 1
name: "Promise"

is there any way to see those methods in the way we write code, so that I could get a better understanding?.

  • 2
    Built-in functions are in the browser's source code, you can't see the details in the console. – Barmar Aug 22 '21 at 15:17
  • As an alternative you can always check out documentations of these methods/properties (for example, [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)), which will give you enough information to understand them thoroughly. – yqlim Aug 22 '21 at 16:12

0 Answers0