From ecc6e57dab5e5496867f2a2aa04160c635d74f1d Mon Sep 17 00:00:00 2001 From: Victor Eke Date: Thu, 13 Oct 2022 10:37:18 +0100 Subject: [PATCH 1/2] feat: add new javascript quiz --- src/data/javascript-quiz.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/data/javascript-quiz.ts b/src/data/javascript-quiz.ts index 53f50b7c5..174e383f7 100644 --- a/src/data/javascript-quiz.ts +++ b/src/data/javascript-quiz.ts @@ -1243,7 +1243,7 @@ const javascriptQuiz = [ ".push() returns the new length of the array, after the element has been pushed", Link: "https://www.freecodecamp.org/news/how-to-insert-an-element-into-an-array-in-javascript/", }, - { + { Question: "In JavaScript, which method allows you to cancel a repeated action created with setInterval()?", Answer: "clearInterval", @@ -1252,8 +1252,8 @@ const javascriptQuiz = [ Distractor3: "stopInterval", Explanation: "This clearInterval() method is used to stop the timed loop that was started by the setInterval() method.", - Link: "https://www.freecodecamp.org/news/javascript-timing-events-settimeout-and-setinterval/", - }, + Link: "https://www.freecodecamp.org/news/javascript-timing-events-settimeout-and-setinterval/", + }, { Question: "In JavaScript, which of the following is NOT the correct way to declare a variable?", @@ -1528,6 +1528,17 @@ const javascriptQuiz = [ "The toFixed() method converts a number to a string and rounds it to a specified number of decimals.", Link: "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed", }, + { + Question: + "In JavaScript, what operator has the highest precedence among these options", + Answer: "Grouping ()", + Distractor1: "Increment ++", + Distractor2: "Unary plus +", + Distractor3: "Equality ==", + Explanation: + "On the precendence table, the grouping () operator is the highest with a precedence value of 18", + Link: "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#table", + }, ]; export default javascriptQuiz; From 2af8b60ff9e16df703138991727ff1281f37fff5 Mon Sep 17 00:00:00 2001 From: Victor Eke Date: Thu, 13 Oct 2022 21:03:29 +0100 Subject: [PATCH 2/2] fix: add recommended changes to src/data/javascript-quiz.ts file fix: add recommended changes to src/data/javascript-quiz.ts file Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com> --- src/data/javascript-quiz.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/javascript-quiz.ts b/src/data/javascript-quiz.ts index 174e383f7..c0a7804fb 100644 --- a/src/data/javascript-quiz.ts +++ b/src/data/javascript-quiz.ts @@ -1530,7 +1530,7 @@ const javascriptQuiz = [ }, { Question: - "In JavaScript, what operator has the highest precedence among these options", + "In JavaScript, which operator has the highest precedence among these options?", Answer: "Grouping ()", Distractor1: "Increment ++", Distractor2: "Unary plus +",