Attempting to write a function

i know its the wrong syntax just want to know if i was using the right thought process to try and create this function

function  Elimintaor()
array = [blocky,leafy,snowball]
 value = Math.Floor.Math.Random( )* 3)
if (value  = array[i] - 1 ){
  
  push.array[i]
                     
}

console.log(Eliminator());

what language is this?

but whatever language I think you want to be sure that you are actually calling the right function. your function call doesn’t match the name of the function

also, you have not explained what your function should do so we can’t know if the thought process is correct or not, as we do not have any info on which we could base it

We would need to know what your function is supposed to accomplish before we could comment on whether you are going about it the correct way.

But you definitely need to work on the syntax.

  • The floor of a Math.random() will always be 0.
  • push adds an element to an array.