function addBracesIfNeeded(input) { if (!input.s...
# 💻developers
b
function addBracesIfNeeded(input) { if (!input.startsWith("{")) { input = "{" + input; } if (!input.endsWith("}")) { input = input + "}"; } return input; } let modifiedInput = addBracesIfNeeded(userInput);