Given an array X, write a program that will remove all negative numbers and replace them with a 0. For example, for array X = [2,-1,4,-3] the output of your program should be [2,0,4,0].
So I searched entire Google, but didn't found any good answers.
This is my code by far:
var x = [2, -1, 4, -3]
for(index in x){
if (index < 0){
console.log('Yra minusas')
}
}