1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2025-05-18 12:02:53 +02:00

chore: better Prettier config for easier reviews

This commit is contained in:
2023-10-23 23:16:24 +02:00
parent d7d5f9a5ac
commit 1e2736b8aa
70 changed files with 1476 additions and 1382 deletions

View File

@ -1,20 +1,20 @@
import readline from 'node:readline'
import readline from "node:readline"
const input = []
const readlineInterface = readline.createInterface({
input: process.stdin,
output: process.stdout
output: process.stdout,
})
readlineInterface.on('line', (value) => {
readlineInterface.on("line", (value) => {
input.push(value)
})
readlineInterface.on('close', solution)
readlineInterface.on("close", solution)
function solution() {
const string = input[0]
const output = string
.trim()
.split(' ')
.split(" ")
.map((word, index) => {
const isFirstElement = index === 0
if (isFirstElement) {
@ -22,6 +22,6 @@ function solution() {
}
return word[0].toUpperCase() + word.slice(1)
})
.join('')
.join("")
console.log(output)
}