Although, parseInt is not designed for that. It's purpose is to turn a string (text) into a number. If the intention is to chop off the fractional part, then Math.floor is the standard function to use.
e.g. start + Math.floor((end - start) / 2)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I see, I missed that detail!
Although,
parseInt
is not designed for that. It's purpose is to turn a string (text) into a number. If the intention is to chop off the fractional part, thenMath.floor
is the standard function to use.e.g.
start + Math.floor((end - start) / 2)