I have a form with more or less 5 inputs , at any given time any of these inputs will be worthless, and I want to find out the lowest value between them, but whenever it has one or more empty inputs it returns the value 0 and indicates that this is the smallest number:
With the inputs I am forming a string with
document.querySelectorAll("input").value;
Receiving the values of input
, but whenever it has a input
empty one of the locations of the string receives zero and the
Math.min();
calculates this value as the smallest value in the string ...
Is there a way to ignore the empty input and not put it in the string? or something similar?