Checking if curr subString is palindrome or not .
let l = 0 , r = curr . length - 1 ; let is_palindrome = true ; while ( l < r ) { if ( curr [ l ] != curr [ r ] ) { is_palindrome = false ; break ; } l ++ ; r -- ; }