JSFiddle - React, Tailwind, and code Playground

by Saurabh Khemka

HTML

String with negative sign reverse

JavaScript

function reverseStr(input){
	let s = input.toString();
  
 	let output='';
  	if(isNaN(s[0])) {
    	output += s[0];
      output += parseInt((s.split('').splice(1,s.length)).reverse().join(''));
    } else {
    
    }
  return output;
}

console.log(reverseStr(-8766))