Try to implemente kmp with JS