ARTICLEViews: 21Share  Posted by - Anonymous

Interview question to reverse string without inbuild function in javascript and typescript

const testStr = "Javascript is great language . I love javascript and React is a javascript framework.";


const reverseStr = (input) => {

 const wordArr = input.split(" ");

 const revArr = [];

 for(let i = wordArr.length - 1; i >= 0; i--){

   revArr.push(wordArr[i]); 

 }

 return revArr.join(" ");

}


console.log(reverseStr(testStr));


Hello Guys, In this video, we'll solve how to reverse a string in 3 approaches. The most asked question in the QA interview.

Reverse string in javascript || Javascript reverse string || Reverse string || Javascript tutorial

JavaScript | Reverse A String Using Built In Methods | DCT Academy | Bangalore

Program to Reverse a String using for loop in JavaScript

Conquer the JavaScript Interview: Integer Reverse [Beginner Skill Level]



Views -