<script> let lists = [ {min: 0, max: 50, price: 1000}, {min: 50, max: 100, price: 5000}, {min: 100, max: 500, price: 10000}, {min: 500, max: 1000, price: 50000}, {min: 1000, max: 5000, price: 100000}, {min: 5000, max: 10000, price: 500000}, {min: 10000, max: 50000, price: 1000000}, {min: 50000, max: 999999999, price: 5000000}, ] input = 200 let list = lists.find((v) => (input > v['min'] && input <= v['max'])); console.log(list); // 結果 // {min: 100, max: 500, price: 10000} </script>
コメント