From 54c7b506402da816b4430c6393a9f4fff91ce624 Mon Sep 17 00:00:00 2001 From: LSvekis Date: Mon, 28 Jun 2021 17:03:45 -0400 Subject: [PATCH] Create ex4 --- chapter 6/ex4 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 chapter 6/ex4 diff --git a/chapter 6/ex4 b/chapter 6/ex4 new file mode 100644 index 0000000..3c7ce2c --- /dev/null +++ b/chapter 6/ex4 @@ -0,0 +1,15 @@ +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();