Method Chaining?

I know that I have chained methods together in the past but I tried it recently and got the error: “TypeError: str.split(…).charCodeAt is not function”

here is the code

 var charStr = str
  return charStr;

Just, what are the parameters for chaining methods in vanilla JS? Thanks!

Split returns an array

The problem is that split returns and array so you are trying to do charCodeAt on an array.