5 kyu
Function Coercion Errors
121wthit56
Description:
When you're learning JavaScript, it can be easy to forget to "call" a function, to add those two little brackets ()
to the end of the function name, and the value of the function is coerced. The problem is, no error is thrown.
Now, there are cases when you'd want to use this functionality. But for this kata, let's assume any time a function is coerced, it means something unintended happen. Your job is to throw an error whenever such a coersion would occur.
function fn() { }
var a = fn;
a === fn; // true
fn < 1; // error
+fn; // error
Language Features
Similar Kata:
Stats:
Created | Apr 16, 2015 |
Published | Apr 16, 2015 |
Warriors Trained | 395 |
Total Skips | 43 |
Total Code Submissions | 945 |
Total Times Completed | 121 |
JavaScript Completions | 121 |
Total Stars | 7 |
% of votes with a positive feedback rating | 88% of 54 |
Total "Very Satisfied" Votes | 43 |
Total "Somewhat Satisfied" Votes | 9 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 16 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 3 kyu |
Lowest Assessed Rank | 7 kyu |