Lodash library locally

I was coding the pad() method of the Lodash library and Codecademy lost connection, so i tried to write the code locally with Atom and then test with a terminal like in Codecademy, but no lucky.

How to use Lodash library locally and how to test it with a terminal?24

1 Like

In the console would be one way to test.

console.log(_.inRange(42, 43, 99))    // false

To run the tests one suspects extra software is required, namely, Node.js. However, Console.assert() may work without Node.js. It may take some extra reading and wrangling to succeed.

1 Like

Codecademy indicates to make it in it’s enviroment or locally, but not indicates how to make it locally and also how to test it:woman_shrugging:

1 Like

Seeing it run as expected in the console should be enough. It is just an ordinary object full of methods, after all.

1 Like

Thanks for your help mtf. I don’t understand yet how to check it locally, maybe the staff of Codecademy could help with this question.

1 Like

As stated earlier, use the console, or write a script with a number of method calls to each of the _ methods. Log out the results and check each one for correctness. If any errors surface, then edit the method and run the script again.

Progress through implementing Console.assert and get that to work, then finally, move on to Node.js and implementations used in the test folder. This is slightly beyond me, but do please keep us apprised of your progress/success.

1 Like