rspec/rules/S3801/description.adoc
Arseniy Zaostrovnykh 7ca29f686f Force linebreaks
2021-02-02 15:02:10 +01:00

9 lines
564 B
Plaintext

Unlike strongly typed languages, JavaScript does not enforce a return type on a function. This means that different paths through a function can return different types of values, which can be very confusing to the user and significantly harder to maintain.
In particular a function, in JavaScript, will return ``++undefined++`` in any of the following cases:
* It exits without a ``++return++`` statement.
* It executes a ``++return++`` with no value.
This rule verifies that return values are either always or never specified for each path through a function.