5 kyu
Even or Odd Accessor 2 : Electric Boogaloo
31 of 34JavaScripts
Description:
Create a function that takes an integer as an argument and returns "Even"
for even numbers or "Odd"
for odd numbers. The function should also return "Even"
or "Odd"
when accessing a value at an integer index. Also this function should evaluate the same when instantiated as an object using the new
keyword.
For example:
evenOrOdd(2); //'Even'
evenOrOdd[2]; //'Even'
new evenOrOdd(2); //'Even'
new evenOrOdd[2]; //'Even'
evenOrOdd(7); //'Odd'
evenOrOdd[7]; //'Odd'
new evenOrOdd(7); //'Odd'
new evenOrOdd[7]; //'Odd'
Language Features
Similar Kata:
Stats:
Created | Jun 2, 2024 |
Published | Jun 2, 2024 |
Warriors Trained | 467 |
Total Skips | 31 |
Total Code Submissions | 262 |
Total Times Completed | 34 |
JavaScript Completions | 31 |
TypeScript Completions | 6 |
CoffeeScript Completions | 3 |
Total Stars | 14 |
% of votes with a positive feedback rating | 97% of 16 |
Total "Very Satisfied" Votes | 15 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 7 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 5 kyu |