We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c22117d commit 4bcab83Copy full SHA for 4bcab83
js codes.docx
@@ -37,6 +37,21 @@ function removeDuplicates(){
37
}
38
console.log(removeDuplicates())
39
output = "aidnI si ym yrtnuoc"
40
+------------------------------------------
41
+var reverseWords = function(s) {
42
+ let res = '';
43
+ let word = '';
44
+ for (let c of s) {
45
+ if (c === ' ') {
46
+ res += word + c;
47
+ word = '';
48
+ } else {
49
+ word = c + word;
50
+ }
51
52
+ return res + word;
53
+};
54
+console.log(reverseWords("priya bagde"))
55
================================================================================================================================================================================
56
Code 5:String reverse with reversing of individual words
57
function withoutReverse(){
0 commit comments