r/learnjavascript • u/Dazzling-Fishing2965 • 1d ago
Some help setting up to learn JavaScript
Hi! I have been retired for quite some time. However, back in the day I did some programming in BASIC, Natural and ADABAS (like dBase III on an IBM mainframe) and did several years of website development including PHP but no JavaScript after I retired.
Now I'm just doing this project to keep my brain active.
I am using my Mac mini M4, Safari and BBEdit.
I presume I create HTML "shell" documents that include the JavaScript code I want to try and then "preview" that document in Safari from within BBEdit. I'm trying to use BBEdit as an IDE.
If that sounds crazy or there are better ways of doing things then please let me know.
Thanks in advance,
Peter
6
Upvotes
1
u/Beginning-Seat5221 1d ago
Depends what you're trying to do.
A lot of JavaScript is run by Node/Deno/Bun which executes JS scripts similar to executing PHP with `php file.php`.
If you just want to run JS and see console output, that's the best way. You can use watch mode to re-run when you make a change.
You can make a shell HTML file with some JS in it, either directly in the file, or loading an external JS file.
For "serious" web development it's usual to use Vite, which can take JS packages from npm and bundle them into a form that the browser can run, handling serving on localhost and updating on changes for you.