Mixed Messages project issues

Hi guys i’m really struggling with this mixed messages portfolio project, basically i went away and wrote a whole JavaScript programme that would basically shuffle a bunch of song choices for the user (il copy the code below) but i really feel that i have missed the mark with this project as we have to do it using node.js but i feel we have been shown barely how to use node. They say you have to write the code using a terminal but are saying you have to use Visual Studio code as well and i’m just getting really confused as to how i’m going about this? Am i writing the code via the terminal or am i writing it through node.js using the terminal? i’m losing my mind over this.

This is the code i have written anyhow
// Variable contains song choices

var songs = [‘Deftones - Diamond eyes’, ‘Metallica - Creeping Death’, ‘Tool - lateralus’, ‘Jay-Z - Encore’, ‘London Grammer - If you wait’, ‘Deftones - Be Quiet And Drive’, ‘Wu-tang Clan - Bring Da Ruckas’, ‘Kanye West - Jesus Walks’, ‘Killswitch Engage - This Fire’, ‘Deftones - Minerva’, ‘Dua Lipa - Be The One’, ‘Johnny Cash - When The Man Comes Around’]

//function shuffles songs on click on the button

function newSong() {

var randomNumber = Math.floor(Math.random() * (songs.length));

document.getElementById(‘Choice display’).innerHTML = songs[randomNumber];

}

Hi @array5952959602
can you provide a link to the exercise? What does it ask you to do what you need node for?
When you have Node installed on your computer, you have access to it’s features from VSCode or any other code editor. You will still write your JS files as before in VSCode and save them as JS. With Node installed, you could make use of modules for example which means you can store your functions in different files and import them to another. And you can use the terminal to push your files to GitHub for example.

1 Like

Where did you write your program? How did you run it?

I’m not sure about this particular project, but generally for an exercise like this the instruction would only be to use a node command in the terminal to run the javascript program, so you can see if the program works.

node file.js

Run nodejs scripts from the command line.

The terminal (or command line) can be accessed from multiple places on your computer. You can access it by itself as the Terminal, or within VSCode (press Ctrl+` to open a terminal down the bottom), or another place (depending on your computer and development environment).

When I’m coding, it’s often easier to use the Terminal within VSCode, as I’ll be writing my program within a file in my code editor (VSCode), and then running it to see if it works, and can do this all within VSCode.

However, if you want to use a different editor to write your program, and/or you want to run your program a different way, you can do that.

yeah sure its the Mixed messages portfolio in the full stack course

https://www.codecademy.com/paths/full-stack-engineer-career-path/tracks/fscp-javascript-syntax-portfolio-project/modules/fscp-mixed-messages/kanban_projects/mixed-messages

Ok, the only mentioning of Node I see here is:

You’ll also want to have Node set up locally to be able to run your script.
And this is what can be found on the linked page:

Node.js is a JavaScript runtime, or an environment which runs JavaScript code outside of the browser.

So you can develop your JS code as you have in the CC environment, you just need Node to see the result as you have to link the HTML file with the JS file.

so just to summarise i’m simply using node to test the code??

Yes. You should use Node to test your code and the Terminal for pushing your project from your computer to your remote repository on GitHub.

Thank you so much you have been a massive help!

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.