You are viewing a single comment's thread. Return to all comments →
function reverseString(s) {
let string="s" let number=0;
try{ if(typeof(s)=== typeof(string) || typeof(s) === typeof(Number(s))){ s=s.split("").reverse().join("") }
} catch(err){ console.log(err.message) } finally{ console.log(s); } } /*
Seems like cookies are disabled on this browser, please enable them to open this website
Day 3: Try, Catch, and Finally
You are viewing a single comment's thread. Return to all comments →
function reverseString(s) {
try{ if(typeof(s)=== typeof(string) || typeof(s) === typeof(Number(s))){ s=s.split("").reverse().join("") }
} catch(err){ console.log(err.message) } finally{ console.log(s); } } /*