From f01f7d6c5a2754eb66fbbe830480d9ba70193376 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 20:50:20 +0530 Subject: [PATCH] Exercise 6.2 --- Chapter 6/Exercise 6.2 | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Chapter 6/Exercise 6.2 diff --git a/Chapter 6/Exercise 6.2 b/Chapter 6/Exercise 6.2 new file mode 100644 index 0000000..cc01504 --- /dev/null +++ b/Chapter 6/Exercise 6.2 @@ -0,0 +1,8 @@ +const adj = ["super", "wonderful", "bad", "angry", "careful"]; + +function myFun() { + const question = prompt("What is your name?"); + const nameAdj = Math.floor(Math.random() * adj.length); + console.log(adj[nameAdj] + " " + question ); +} +myFun();