简体   繁体   中英

How can i find a source code of a function in Javascript?

I need to find out how exactly a function works, so where can i find the source code of function in Javascript?

For example: arr.sort(function(a, b){return ab});

this function sort() gonna sort all index of an array.

But i don't know how this function compare all the Index to each other specifically

To direct answer the question you asked, you can find function source code like this:

console.log([].sort);

or

console.log(myFunc);

This works with any function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM