Day 3: Try, Catch, and Finally

Problem Link

Solution

tryCatchFinally.js
if (typeof s === "string") {
    console.log(
      s
        .split("")
        .reverse()
        .join("")
    );
  } else {
    console.log("s.split is not a function" + "\n" + s);
  }

Last updated

Was this helpful?