if it’s a console you can add lookup on its own line after it is defined and it should print like I did in the browser console, or you can use console.log to print it for sure
Nothing for me either. If I delete the code and do a simple log statement and hit run, that works. But anything more complicated and it doesn’t work.
Also that cross at line 8?
The squiggly line means that it doesn’t recognize that code, specifically the spread operator. If select the “stage-1” toggle on the left, it goes away. That seems odd to me because it is part of ES6, and has been around for a long time.
What is this site supposed to be? You can’t find a tool on the side of the road and assume what it does. It looks to me like it was meant to see how different versions of React compile and transpile. It also seems out of date - it goes up to es2017 but we’re on es2021 and es2022 is right around the corner. I’d just forget about this site.
I tried executing the code I’ve posted and I get this "No debugger available, can not send variables’ messag’. What does this mean exactly? And how do I go about running my code.
Thanks, I went ahead and installed Quokka. Although I still want to know exactly what this can no sent ‘variables’ message means exactly and how can I simply use console.log(lookup) to return the expected object mentioned previously?
As in how can I have my code executed in the terminal as shown in the video? Still very new to this so apologies for what probably seems like obvious incompetence.
Do I need to install some sort of debugger extension for node.js?
If you want to run a debugger, then yes. I don’t know, I almost never use the VSC terminal. If I do, I just use the terminal, but I almost always just use a separate terminal window. I see that you have “Debug Console” selected. Is there a reason you are using that instead of the terminal? I’m sincerely asking - I haven’t used that much.
When I run the Run and Debug feature, I get the same message as you, when I try to expand the output. After a little research, it sounds like you need to set up a launch.json and set up a debugger.
You can just run it using node.js from the console node someFileName.js.
If you want to use the debugger you should be able to click the “Run and Debug” button and then pick node.js from the dropdown.
If you want to customize it you can click the link that says “create a launch.json file”, select node.js from the dropdown and it should create a .vscode folder with a launch.json file inside it. Make sure you opened VS Code inside the folder with the file you want to run and that you select the file in the file explorer before switching to the debug tab in VS Code. Now you should be able to click the run icon or press F5.
Follow the docs in the link that was posted or look on YouTube I’m sure there are setup instruction videos.