Is it possible to have a input field where user can input the array and the function which it passes the value treats it as an array? To be clear, is this possible using javascript and HTML?
<input....of some type....>
function (from input as a form of array){
calculation
}
I would like to have an input field where I can input something like [1,2,3,4..] or [(1,2),(2,3)...] and pass that to the function without any further manipulation, hoping that it will treat the array as array not as 'text'. I think I can use eval but I don't want to trust the user.
[(1, 2), (2, 3)]end up creating exactly?JSON.parsefor the simple array though.