'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
Post a Comment