'in' operator in JavaScript. String comparison -


this question has answer here:

hi i'm new in javascript , find basic problem:

when use piece of code in python:

'a' in 'aaa'  

i true

when same in javascript error:

typeerror: cannot use 'in' operator search 'a' in aaa 

how similar result in python?

i think 1 way use string.indexof()

'aaa' .indexof('a') > -1 

in javascript in operator used check whether object has property


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -