---
title: "Discussion on \"JavaScript: Convert last character of each word to uppercase\" | Hashnode"
description: "Discussion on \"JavaScript: Convert last character of each word to uppercase\". function changeLastCharacterToUpperCase (str) {\n  return str.split(\" \").map( (item) => {\n    return item.slice(0, -1) + item[item.length - 1].toUpperCase();\n  }).join (\" \");\n}\n\nconsole.log(changeLastCharacterToUpperCase('hello world welcome testing a..."
url: "https://hashnode.com/posts/javascript-convert-last-character-of-each-word-to-uppercase/63312ea3a50ebf1cd14924a5"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [JavaScript: Convert last character of each word to uppercase](https://harikrishna.hashnode.dev/javascript-convert-last-character-of-each-word-to-uppercase?utm_source=hashnode&utm_medium=feed)

function changeLastCharacterToUpperCase (str) { return str.split(" ").map( (item) => { return item.slice(0, -1) + item\[item.length - 1\].toUpperCase(); }).join (" "); } console.log(changeLastCharacterToUpperCase('hello world welcome testing a...

Jan 20, 2022 · 1 min read · harikrishna.hashnode.dev  
Read the article

-   [#last-character](https://hashnode.com/tag/last-character)
-   [#upper-case](https://hashnode.com/tag/upper-case)

## Written by

[Hari Krishna Anem](https://hashnode.com/@hkrishna)

@hkrishna · Hyderabad, India

  
[View profile](https://hashnode.com/@hkrishna)

Full stack developer

Full stack developer (ReactJS, NodeJS, JavaScript, PHP, SQL)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
