javascript - Generate in the console an array of negative numbers -
how generate in console array of negative numbers click of button? need simplest way (no jquery) - i'm beginner.
<input type="button" value="generate in console array of negative numbers" id="cmdswitch"/>
class="snippet-code-js lang-js prettyprint-override"> function generatearray() { var arr = []; (var = 0; < math.random()*100;i++){ arr[i] = (math.random() * 100) * -1; } console.log(json.stringify(arr)); homecoming arr; }
javascript onclick
No comments:
Post a Comment