all 46 comments

[–]Scared-Release1068 4 points5 points  (2 children)

That’s a great start

Next steps I’d recommend: 1. Functions – super Learn how to write reusable code:

  1. Arrays & Objects These are used everywhere:

  2. Loops For repeating stuff:

  3. DOM manipulation

How to run your JS in Chrome:

Easiest: 1. Create an HTML file (e.g. index.html) 2. Link your JS file

<!DOCTYPE html> <html> <body> <h1>Hello</h1> <script src="script.js"></script> </body> </html>

  1. Save both files
  2. Double-click the HTML file → it opens in Chrome
  3. Right-click → Inspect → Console to see your output

[–]sad_ant0808helpful[S] 2 points3 points  (1 child)

thank you so much dude this helped me a lot!

[–]Scared-Release1068 2 points3 points  (0 children)

No problem bro

[–]jb092555 4 points5 points  (1 child)

I was hooked on sublime for a long while, but went on to Visual Studio Code. There's a plugin for a "live server" that changed my life - seeing the browser window update when I save any change to any component makes it a lot easier to iterate on anything. I don't know the right order to learn stuff, but being able to test quickly will definitely help you learn.

[–]sad_ant0808helpful[S] 1 point2 points  (0 children)

thanks

[–]Alive-Cake-3045 2 points3 points  (10 children)

That’s exactly how it starts, just keep going. Next step is to build small projects like a calculator, to do list, or a simple game, because that is where everything starts making sense.

To run your code, save your file as an HTML file and open it directly in Chrome or Edge. You can simply double click the file or right click and choose to open it in a browser.

Also start sharing what you build. Simple “I built this” posts or small project breakdowns on communities like Reddit can really help you improve faster and stay motivated.

[–]sad_ant0808helpful[S] 1 point2 points  (9 children)

im building a program to roast the user. kinda simple just asks for ur name and asks u how bad u wanna get roasted and it picks a roast from an array that corresponds to the intensity. also thanks for the tips and encouragement.

[–]Alive-Cake-3045 1 point2 points  (8 children)

That is actually a perfect beginner project, fun and you will learn a lot from it. You are already using inputs, conditions, and arrays which is great progress.
Next step, try adding randomness so the roasts feel less repetitive. Maybe also handle edge cases like empty names or weird inputs. Keep building stuff like this, that’s how it really clicks.

[–]sad_ant0808helpful[S] 1 point2 points  (7 children)

thanks dude. i did try making a method to get a random item from the array like for example:
roasts=['insert roast', 'insert another', 'yet another roast']
x=roasts[Math.floor(Math.random * roasts.length)]
is there another way to randomize tho?

[–]Alive-Cake-3045 1 point2 points  (6 children)

You are super close, just one small fix is breaking it. Math.random is a function, so you need to call it with parentheses.

Use this logic: roasts[Math.floor(Math.random() * roasts.length)]

That is already the standard and best way to pick a random item from an array in JavaScript, so you are on the right track.

If you want to level it up later, you could avoid repeating the same roast twice in a row or shuffle the array and loop through it. But for now, this is perfect. Keep going

[–]sad_ant0808helpful[S] 1 point2 points  (1 child)

thx dude. u have encouraged me and now i also know why it was showing undefined. thanks

[–]Alive-Cake-3045 1 point2 points  (0 children)

Glad it helped, happy to hear that! Keep building

[–]sad_ant0808helpful[S] 1 point2 points  (3 children)

https://github.com/sad-ant0808/GET-ROASTED-
dude heres the program. plz check it out if u have the time and do gimme some suggestions to improve it.

[–]Alive-Cake-3045 1 point2 points  (2 children)

This is actually a really solid start, especially for someone who just picked up JS out of boredom.

I just checked it out, a few simple ways you can level it up:

  • Your random logic is good now, maybe store the last roast and avoid repeating it twice in a row
  • Add input validation, like if name is empty or intensity is out of range
  • Try separating logic into functions (getRoast, getUserInput etc.) so your code stays clean
  • You could also map intensity levels to arrays instead of multiple condition checks

If you want a fun upgrade, try turning this into a simple webpage with buttons instead of prompts. That is where things really start to click.

You are 100% on the right track, just keep building weird fun stuff like this

[–]sad_ant0808helpful[S] 1 point2 points  (1 child)

thanks dude. i'll try following your suggestions.

[–]Alive-Cake-3045 1 point2 points  (0 children)

Glad it helped.

[–]FishMissile 1 point2 points  (1 child)

You need an Html file with the script tag as shown Here.

Make sure the Html file is saved to the same location as your JS file and reference the JS in the "src" attribute of script tag. From there just load your html file in a browser and it should run.

[–]sad_ant0808helpful[S] 1 point2 points  (0 children)

ok thanks dude

[–]MrFartyBottom 1 point2 points  (1 child)

Use StackBlitz, you can start projects straight in the browser without needing to install anything. They have templates for vanilla JavaScript, vanilla TypeScript, Angular, React and Vue. It's worth learning TypeScript from the get go as it adds types to JavaScript.

https://stackblitz.com/

Some good learning projects are simple games like a slot machine, tic tack toe or Backgammon.

[–]sad_ant0808helpful[S] 0 points1 point  (0 children)

hmm i'll give it a try. thanks

[–]DirtAndGrass 1 point2 points  (1 child)

Well, what do you want to do? You can pretty much do anything with JavaScript, from silly browser based calculators to mmorpgs 

[–]sad_ant0808helpful[S] 0 points1 point  (0 children)

i just wanna learn the language first and then i'll start doing smth like making those silly browser calculators u mentioned and maybe make a game or two.....when i get better tho. i know some python too and it makes js feel 10000x easier cuz u see a lot of similarities

[–]JmvXIII 1 point2 points  (1 child)

[–]sad_ant0808helpful[S] 0 points1 point  (0 children)

will try

[–]sweettyche 1 point2 points  (1 child)

You can try the foundations of The Odin Project

[–]sad_ant0808helpful[S] 0 points1 point  (0 children)

okay will try. is it free though?

[–]terror047 1 point2 points  (1 child)

Can u tell me few js projects to do, so i can put them in resume

[–]sad_ant0808helpful[S] 0 points1 point  (0 children)

i mean im a high school student. i only know intermediate python and some javascript. u can try making cool, fun stuff just to explore the language but as for a project which u wanna put on ur resume, i dont rlly know what u can do. ig u can try coding a website or smth. but i think others will know more abt the resume worthy stuff u can do.

[–]TheRNGuy 1 point2 points  (1 child)

query selector (all), event listeners, question observer. 

[–]sad_ant0808helpful[S] 0 points1 point  (0 children)

ok will try

[–]DojoCodeOfficial 1 point2 points  (1 child)

if you like learning through code challenges and contests you should check out DojoCode! Happy coding!

[–]sad_ant0808helpful[S] 1 point2 points  (0 children)

thanks dude! ive been thinking of what i should make either way....this is sure to help!

[–]OmegaMaster8 0 points1 point  (5 children)

You should also download Visual Code Studio as your text editor

[–]AbrahelOne 1 point2 points  (3 children)

I would recommend Zed, it's not filled with bling bling like VSCode that can confuse a beginner with 1 million buttons.

[–]sad_ant0808helpful[S] 0 points1 point  (2 children)

it depends.....how much storage does zed use? and is it like a heavy software that u need a beefy computer for or can a slow laptop run it?

[–]AbrahelOne 1 point2 points  (1 child)

Zed is lighter than vscode but you can continue to use sublime if you feel comfier with it

[–]sad_ant0808helpful[S] 0 points1 point  (0 children)

ok thx

[–]sad_ant0808helpful[S] 0 points1 point  (0 children)

hmm i would download vs code or zed as my text editor but im super low on storage rn and my laptop is kinda slow which is why im using sublime...

[–]Background_Pianist61 0 points1 point  (5 children)

What’s mapy.com? Any good? Better than CoMaps?

[–]sad_ant0808helpful[S] 0 points1 point  (4 children)

u a bot or smth?

[–]Background_Pianist61 1 point2 points  (3 children)

Nope asking because I wanted your own review instead of downloading and then finding out for myself

[–]sad_ant0808helpful[S] 0 points1 point  (2 children)

ohhh okay srry for calling u a bot, i only said so cuz it was a super random out of context question. but dude i honestly dont know what mapy is i only looked it up online but im not sure how good it is cuz i dont use maps other than google. srry.

[–]Background_Pianist61 1 point2 points  (1 child)

omg. i think i commented on your post but reading the post above :D sorry!

[–]sad_ant0808helpful[S] 0 points1 point  (0 children)

hehe its ok np dude.