NA +91-8727899942 thecoderjob@gmail.com

CHAPTER - 7

Reverse a string in javascript.

Here's is the Code !!

// Neel.B
function reverseString(str){
	console.log(str.split('').reverse().join(''))
	//OR
	const data = [...str]  
	const strLength = data.length-1
	let reverseStr = ''
	for(let count = strLength; count > -1; count--){
		reverseStr += data[count] 
	}
	console.log(reverseStr)	 
}

reverseString('This is a given data')
//output : atad nevig a si sihT

Chapter 6

Behavior of this keyword in javascript.

Previous chapter

Chapter 8

Here are some important CLI commands

Next chapter

Get In Touch

NA

thecoderjob@gmail.com

+91-8727899942

Popular Links

© www.thecoderjob.com. All Rights Reserved.               Designed by HTML Codex