- In the project root folder run:
npm install
(ornpm i
).
- In the project root folder run:
npx jest --watchAll
Write a function called doParenthesesMatch(stringToCheck): "yes" | "no"
that takes a string of text and returns "yes" if the parentheses are balanced and "no" otherwise.
doParenthesesMatch("({word})") // returns "yes"
doParenthesesMatch(")([]") // returns "no"
doParenthesesMatch("fdd(dsd(dsdss(1))dsds)ddsd]") // returns "no"
doParenthesesMatch("") // returns "yes"
Write a class called ParenthesesMatcher
that has a method called doParenthesesMatch(stringToCheck): "yes" | "no"
that takes a string of text and returns "yes" if the parentheses are balanced and "no" otherwise.
const matcher = new ParenthesesMatcher("({word})")
matcher.doParenthesesMatch() // returns "yes"
const matcher = new ParenthesesMatcher(")([]")
matcher.doParenthesesMatch() // returns "no"
const matcher = new ParenthesesMatcher("fdd(dsd(dsdss(1))dsds)ddsd]")
matcher.doParenthesesMatch() // returns "no"
const matcher = new ParenthesesMatcher("")
matcher.doParenthesesMatch() // returns "yes"