Retired

Talking about types and args (retired)

Description:

Write a function that should receive a dynamic number of arguments of type number, string, or boolean. and then return all parameters concatenated by hyphen "-".

If any other type is passed, then return undefined

Example:

{
  const result = magicFunction(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
  console.log(result) // must be "1-2-3-4-5-6-7-8-9-10"
}

{
  const result = magicFunction("a", 2, "b", 4, "c", false);
  console.log(result) // must be "a-2-b-4-c-false"
}

{
  const result = magicFunction("a", 2, "b", 4, "c", null);
  console.log(result) // must be undefined
}
Fundamentals

Stats:

CreatedJun 16, 2022
Warriors Trained17
Total Skips0
Total Code Submissions32
Total Times Completed13
JavaScript Completions13
Total Stars0
% of votes with a positive feedback rating38% of 12
Total "Very Satisfied" Votes3
Total "Somewhat Satisfied" Votes3
Total "Not Satisfied" Votes6
Total Rank Assessments12
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • gleisonkz Avatar
Ad