Mjs splice error

If you are asking a question, please follow this template:

  1. My goal is: [describe your goal]
    to split a buffer using mjs splice command

  2. My actions are: [describe your actions - code, commands, etc]
    stripped down to the simplest:
    let msgtest = ‘{“command”:888}{“command”:888}’;
    print (‘msgtest:’, msgtest);
    msgtest.splice(15,15);

  3. The result I see is: [show the result - log, etc]
    msgtest: {“command”:888}{“command”:888}
    [Jun 18 09:37:55.993] at init.js:125
    [Jun 18 09:37:55.995] MJS callback error: type error

  4. My expectation & question is: [describe your expectation and your question]
    msgtest==={“command”:888}
    Why is splice giving me a type error?

splice does not exist.
Try slice.

1 Like