Chartjs-How to sum the array value in javascript like chartjs data array and input value sum

3๐Ÿ‘

let num = [3, 2, 5, 3, 2, 5, 3, 45, 2, 3, 4, 2];

function myFunction(t){
  console.log(num.map(elem => elem + parseInt(t.value)));
}
 <input type="number" onkeyup="myFunction(this)">

This is what you need right ?

Leave a comment