// Function to reverse NumberfunctionreverseNum(n){let r = n.toString().split('').reverse().join('');returnMath.sign(n)*parseInt(r);}// CallreverseNum(-267);reverseNum(31522);// Outputs-76222513
// how to reverse number in javascriptlet number =12345;let reverse =parseInt(number.toString().split('').reverse().join(''));console.log(reverse);// Output:// 54321
let rev =0;let num =123456;let lastDigit;while(num !=0){
lastDigit = num %10;
rev = rev *10+ lastDigit;
num =Math.floor(num/10);}console.log("Reverse number : "+rev);
const num =3849;functionreverseGivenInteger(num){returnNumber(String(num).split('').reverse().join(''))}console.log(`Reversed integer is: ${reverseGivenInteger(num)}`)
var text =""var i =0var array =["1","2","3"]var number = array.lengthvar arrayFinal =[]for(i =0; i < array.length; i++){
text = array[number -1]
arrayFinal.push(text)
text =""
number = number -1}console.log(arrayFinal)