Skip to content

Commit 3edad4f

Browse files
author
Victor Homyakov
committed
Merged nested if() into single expression
1 parent d017062 commit 3edad4f

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)