Software for javascript

Plz i need software tool to test my JS code on my PC plz any recommendation

You can set up a Node environment. Many editors (like VSC) will allow you to run a Node environment from your editor. If worst comes to worse, you can use a script tag to load the JS file into an HTML file and run that in a browser window.

1 Like

But i need one dat can show me d output immediately wen i run d program like d one on FCC

All of those will show you output immediately. It won’t be in the exact same format as FCC, but you can see the code and the output - that is all that is needed.

ok thanks,
plz i need a navigation no hw i do dat on VSC becos i just downloaded VSC .
so i need hw am going to navigate on VSC to show output of my result wen writing my program.

1 Like

thanks for dis
but plz i need a little favour with my code plz can u help me.
here:
const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];

const squareList = (arr) => {

“use strict”;

// change code below this line

const squaredIntegers = arr;

// change code above this line

return squaredIntegers;

};

// test your code

const squaredIntegers = squareList(realNumberArray);

console.log(squaredIntegers);

What have you tried? Your code seems to just be the starting code. We can’t help you unless you give us something to work with.

Look at the filter and map array methods, also look at the Number and Math object methods. Use MDN to look for the information.

here is wat i tried but i dont knw hw to eliminate the decimal integers
const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];

const squareList = (arr) => {

“use strict”;

// change code below this line

const squaredIntegers = realNumberArray.map(realNumberArray=> parseInt( realNumberArray**2));

// change code above this line

return squaredIntegers;

};

// test your code

const squaredIntegers = squareList(realNumberArray);

console.log(squaredIntegers);

  1. realNumberArray is a global, use the arr parameter. The realNumberArray array is being passed in as an argument.

  2. Did you try and search for some way to “eliminate the decimal integers”, try putting this into Google “positive integers javascript”. Again, I would look at the Number object for a method.

  3. Maybe you can filter the array using the above for the condition?

  4. Is there maybe a Math method that can square the numbers given back from the filter method?

This one isn’t that easy I will say. Below is one way the general chain of method calls might look. Don’t look unless you have to.

Summary
const squaredIntegers = arr.filter( num => * filter out non positive integers *).map(num => * square the numbers *)

let me show u wat i did with ur summary. its a little long but with wat ur summary u gave me i arrived at this and its wrk fine .thanks
const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2];
const squareList = (arr) => {
“use strict”;
// change code below this line
const squaredIntegers = realNumberArray.filter((realNumberArray)=>realNumberArray>0 && realNumberArray%1===0).map(realNumberArray=>(realNumberArray**2));
// change code above this line
return squaredIntegers;
};
// test your code
const squaredIntegers = squareList(realNumberArray);
console.log(squaredIntegers);

Helped me a lot solved one-off my queries.

  1. Please surround your code with backticks to make it easier to read (you can do it using the </> button in the message editor

  2. Don’t use the global variable inside the function, use the function parameter otherwise your function can’t be reused

  3. Inside the methods you may want to use a different name for the parameter of the callback, otherwise it can create great confusion (realNumberArray inside the method is a completely different thing from the realNumberArray that is the global variable)

  4. You can also use Math.pow() to do the elevation to power, in case you need a different way of doing it

Hi, @babawande01
There are a couple kinds of Javascript, so I’ll talk about both of them.

  1. Node.JS is a server-side version of JavaScript that lets you develop back-end (the part of the server that sends you web pages and stuff). You need to download NodeJS if you’re going to use it (or you could use something like Cloud9 that hosts it in the cloud for you).
  2. Client-Side Javascript is your “normal” javascript which runs in your browser. You don’t need any special code for this, other than a browser.

For both of these you need a code editor. This’ll let you edit html and JS files, and can be used for both NodeJS and Client-Side Javascript. I use Brackets, but Atom is a popular one. There are thousands of code editors, so you can be a little picky here :wink:.