Hello everyone, i need someone to explain to me why in FCC solution they wrote first and _$Second in parentheses?
if (typeof (first) === “number” )
If (typeof (_&Second) === “number) return first + _$Second;
I WROTE THE SOLUTION LINK BELOW, AND I WROTE THE FULL CODE
function addTogether() {
const [first, _$Second] = arguments;
if (typeof (first) === “number” ) {
If (typeof (_&Second) === “number) return first + _$Second;
If (arguments.length === 1 ) return (_$Second) => addTogether(first, _$Second);
}}
addTogether(2,3);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15
Challenge Information:
Intermediate Algorithm Scripting - Arguments Optional
They wrote second, i accidentally wrote it like that, but that’s was not my point.
MY POINT IS.
why did they wrote typeof (first)? Why did they put the variable inside parentheses
system
Closed
5
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.