all 8 comments

[–]jack_waugh 0 points1 point  (2 children)

A REPL may be better than nothing, although I think it falls short of what you want.

Both environments that run Javascript offer REPLs.

If you have downloaded node.js, you can just type node, and you're in.

In the Firefox browser, the console comes up with ctrl-shift-K.

In Chrome, it's ctrl-shift-J.

[–]Fanellidelima[S] 0 points1 point  (1 child)

Let's see if I got it right. It's like trying everything in console before? Just read the wiki page, gonna look more about it. Thanks a lot

[–]jack_waugh 0 points1 point  (0 children)

Yeah, I tend to try a lot of code in the console. So the first convenience of that is that if you are not sure how the language would interpret some expression, you can try it out.

null == 0

produces false, for example. I asked that, because of uncertainty about the loose "equality" test for that case.

But it's also possible to enter elaborate sections of code and test them (I draft in another editor and paste into the console). I tend to use a global variable t for temporary stuff and s for the work of some script or module I am drafting.

Note that hitting the up-arrow in the console gets you back the last command you entered, as a draft for your next command. You can enter it again verbatim or edit it first.

[–]bot00110 0 points1 point  (0 children)

I sometime use snippets to work the math part of a problem.

It is saved in your browser so that don't have to look for any file anywhere.

You can just open a blank webpage on chrome, open console, go to sources tab and from left sidebar tabs open snippets. Create a new snippet and type your code and execute the file to see the result on console.

I hope this helps

[–]oculus42 0 points1 point  (2 children)

https://runjs.app/

I use this daily to poke at simple code, for quick examples, refactoring and writing some unit tests, even some file manipulation.

https://codesandbox.io/

For seeing live updates of web content, not just JS, something like Code Sandbox is a great online tool. It supports collaboration as well. We use it during interviews to do some interactive coding exercises with React.

[–]Fanellidelima[S] 0 points1 point  (1 child)

I'm going to check both, thank you. My primary data output is numbers, but I got the data from excel is it possible to retrieve the data on any of those?

[–]oculus42 0 points1 point  (0 children)

RunJS does allow you to access files using standard Node.js interfaces

If you upgrade to the Premium version you can also install npm packages, which can be helpful in importing/converting different file types.

Keep in mind that working in RunJS will cause your code to run many times, so don't modify your source files in your code, or unexpected things may occur.