ARTICLEViews: 30Share  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));


Most Asked Interview Questions || Reverse Array elements without using inbuilt method #javascript #reactjs #vuejs #angularjs ...

3 Different Ways to Reverse a String in JavaScript

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

How to Reverse Arrays in JavaScript Without Using reverse()|JavaScript Coding Challenges | Beginners

Coding Interview Questions (Reverse A String) - Episode 1



Views -