Use the String.indexOf() MDN Docs method
if( aa.indexOf('aa') != -1 ){
// do whatever
}
Update
Since ES6, there is a String.includes() MDN Docs so you can do
if( aa.includes('aa') ){
// do whatever
}
Use the String.indexOf() MDN Docs method
if( aa.indexOf('aa') != -1 ){
// do whatever
}
Update
Since ES6, there is a String.includes() MDN Docs so you can do
if( aa.includes('aa') ){
// do whatever
}