Re-creating the Lodash Library inRange

I am getting an error when running
$ node test/in-range.js

Can anyone see what I doing wrong? Thank you.

Your boolean function checking the range excludes the start value whilst the start value should be included. So in your case it should be:

if (value >= start && value < end) {
isInRange = true;

Thank you for the help. That would have been a problem.

But it turns out that that was not what was giving me my error. It was the way I was checking if end was undefined. THanks for the help.

1 Like

Doh… It should have been undefined without the "" right?

I actually just changed it to

if (!end) {


and that worked.

Well, somebody have a problem with the terminal. I’ve tried every single way, either on codecademy browser/terminal or mine, i can not route the node test/in-range.js … i’ve tried many different routing, it’s keeping telling me that it do not find the folder. On both browser, either my code is working for sure because i’ve tried it several time on many different ways …

Hi everyone, does anyone know why it won’t check my ‘InRange’ method? I don’t understand the error. It checks my clamp one fine…

try node test/in-range.js

seems to be missing the dash between in-range