0

How can I print in the console, native properties and methods? Like for example, I have an array and I want to know all native functions like: sort(), shift(), pop()... etc, without need to research the JS library. And the console must return these methods.

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
claudiopb
  • 1,056
  • 1
  • 13
  • 25
  • Are you asking how to see all array methods or all native functions in general? Do you also want web API functions etc...? – Nick Parsons Mar 30 '20 at 12:18

2 Answers2

1

Yes, you can press F12, go to console and type in for example console.log(Array.prototype)

Same you can do with String, Object, Number

enter image description here

bill.gates
  • 14,145
  • 3
  • 19
  • 47
  • There is any way? without need to attach the js code to a HTML file? Because I like to study js files only, running in the shell attaching in package,json using yarn start – claudiopb Mar 30 '20 at 12:26
  • you want only to use js without the need of an html file and browser? then just install node.js on your computer. after you installed it , i would strongly recommend, to use visual studio code. then you open some folder, create an file for example `test.js` and then you open the terminal, or with the key CTRL + SHIFT + Ö in my case then you can simply write `node test.js` and it will run your js code in a shell – bill.gates Mar 30 '20 at 12:29
  • I hope you mean something like this: https://code.visualstudio.com/docs/nodejs/nodejs-tutorial but first you will need to install node.js from https://nodejs.org/en/ – bill.gates Mar 30 '20 at 12:31
1

Array.prototype have all the information.

console.log(Array.prototype);
uiTeam324
  • 1,215
  • 15
  • 34