Skip to content

Commit

Permalink
Corrected indexOf usage (to emulate contains).
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiSG committed Mar 12, 2012
1 parent fec6122 commit 424d3d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.html
Expand Up @@ -210,7 +210,7 @@
'hello'.indexOf('e') // 1
'hello'.lastIndexOf('l') // 3

if ('hello'.indexOf('lo')) { console.log('found'); } // everything is evaluable in JS
if ('hello'.indexOf('lo') != -1) { console.log('found'); }

(new Array(3 + 1)).join('hello') // 'hellohellohello'

Expand Down Expand Up @@ -413,7 +413,9 @@

'delete': 'https://developer.mozilla.org/en/JavaScript/Reference/Operators/delete',

'unary plus': 'https://developer.mozilla.org/en/JavaScript/Reference/Operators/Arithmetic_Operators#.2B_(Unary_Plus)'
'unary plus': 'https://developer.mozilla.org/en/JavaScript/Reference/Operators/Arithmetic_Operators#.2B_(Unary_Plus)',

'!= -1': 'http://stackoverflow.com/questions/1789945/javascript-string-contains'
}

var ruby = {
Expand Down

0 comments on commit 424d3d3

Please sign in to comment.