From 3fdf8bddb361024246810a69471f2826b96d3b7c Mon Sep 17 00:00:00 2001 From: Patrick Mwangi <82177473+frashid17@users.noreply.github.com> Date: Wed, 11 Dec 2024 00:14:55 +0300 Subject: [PATCH] Update solution.md added another solution that worked for me --- .../08-operators/4-fix-prompt/solution.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/1-js/02-first-steps/08-operators/4-fix-prompt/solution.md b/1-js/02-first-steps/08-operators/4-fix-prompt/solution.md index 209a0702c4..f2acb8d9c7 100644 --- a/1-js/02-first-steps/08-operators/4-fix-prompt/solution.md +++ b/1-js/02-first-steps/08-operators/4-fix-prompt/solution.md @@ -30,3 +30,16 @@ alert(+a + +b); // 3 ``` Using both unary and binary `+` in the latest code. Looks funny, doesn't it? + +or in the `alert`: you can do it this way + +```js run +let a = prompt("First number?", 1); +let b = prompt("Second number?", 2); + +alert(Number(a) + Number(b)); +``` + + + +