-
Write a NodeJS program that produces the sum of its arguments:
$ node sum-args.js 1 2 3 4 10 $ node sum-args.js abra kedavra NaN
-
Write a program that draws a triangle like the one below given the height as an argument (using
for
and then usingwhile
):$ node triangle.js 5 * ** *** **** *****
-
Write a program that receives 2 operands and an operation and produces the result:
$ node expr.js 15 + 14 29 $ node expr.js 2 '*' 3 6 $ node expr.js 1234 / 16 77.125