because with your approach you are unable to distinguish between addTogether(5) and addTogether(5, undefined), in both cases the second argument becomes null
it looks like that to solve this lab there is a feature needed that is not taught in the curriculum before it
That is my bad. I was almost insane at that time when I was thinking about how to figure it out using what I`ve learned before.I think I am alittle bit Incoherent before I post my code…
I was wondering how! I was searching how to figure out how to check the number of arguments online, and yeah. Arguments.length is not taught in the curriculum yet.
Arrays in JavaScript have a special length property that returns the number of elements in the array. You can access this property using the length keyword. For example:
let fruits = ["apple", "banana", "orange"];
console.log(fruits.length); // 3
Another key characteristic of arrays in JavaScript is that they are dynamic, meaning that their size can change after they are created. You can add or remove elements from an array using various array methods, such as push(), pop(), shift(), unshift(), splice(), and more. These methods will be taught in upcoming lectures.
Array.length has been taught in the first lesson of introducing Array.