in this project of lodash project that hire to create an object called (_) and in this project we add a clamp method that had three argument like this :
module.exports = _;
const _ = {
clamp(number, lower, upper) {
let lowerClampedValue = Math.max(number, lower)
let clampedValue = Math.min(lowerClampedValue, upper)
return clampedValue
}
.clamp(4, 5, 6)
then i use to run this code in the tereminal as that “node test/clamp.js” but it return me:
$ node test/.clamp.js
module.js:472
throw err;
^
Error: Cannot find module ‘/home/ccuser/workspace/underscore-javascript-capstone/test/_.clamp.js’
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module.load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)
at bootstrap_node.js:542:3
$ node test/.clamp.js
module.js:472
throw err;
^
Error: Cannot find module ‘/home/ccuser/workspace/underscore-javascript-capstone/test/_.clamp.js’
at Function.Module.resolveFilename (module.js:470:15)
at Function.Module.load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)
at bootstrap_node.js:542:3
4,5,6
bash: 4,5,6: command not found
node test/clamp.js
/home/ccuser/workspace/underscore-javascript-capstone/.js:15
console.log(.clamp(5, 4 ,6))
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions…js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/home/ccuser/workspace/underscore-javascript-capstone/test/clamp.js:1:73)