Skip to content

Commit 291edcd

Browse files
Merge pull request prototypejs#78 from victor-homyakov/patch-27
Merged nested if() into single expression
2 parents b0b9c93 + 3edad4f commit 291edcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/prototype/lang/enumerable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ var Enumerable = (function() {
402402
* // -> true ('3' == 3)
403403
**/
404404
function include(object) {
405-
if (Object.isFunction(this.indexOf))
406-
if (this.indexOf(object) != -1) return true;
405+
if (Object.isFunction(this.indexOf) && this.indexOf(object) != -1)
406+
return true;
407407

408408
var found = false;
409409
this.each(function(value) {

0 commit comments

Comments
 (0)