all it says is “Run this code, open your console, and inspect the result object.” yeah, how exactly do i do that? npm index.js? npm start?
If I understand your question…that all depends on how your app is set up.
If you made your app with Create React App or Next.js you would use npm start
/ yarn start
which will run the start scripts and your app.
Look in your projects package.json
file under scripts section. There may be a few options there.
Are you using a module bundler like Webpack? Do you have start scripts?
Typically your entry file is going to be index.js
(in your project root) where the ReactDom.render()
method is mounting your react app to a root dom node. Assuming you have no start scripts and you aren’t needing something like Babel or Typescript, run
node ./index.js