in the /chemics route you are finding matches in your .json file, and breaking when you have 7 results.
You both push to the ret array and increment limit at the same time. You could replace limit with ret.length and have the same result with less variables/complexity.
I love :heart_eyes: that you're using break to stop yourselves from looping through extra elements unnecessarily though.
in the
/chemics
route you are finding matches in your.json
file, and breaking when you have 7 results.You both push to the
ret
array and incrementlimit
at the same time. You could replacelimit
withret.length
and have the same result with less variables/complexity.I love :heart_eyes: that you're using break to stop yourselves from looping through extra elements unnecessarily though.