Skip to content

Commit

Permalink
feat: añadir mi resultado del reto mouredev#28 con typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelangelamengual committed Jul 12, 2023
1 parent cba92e9 commit fb54a84
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const checkMathExpression = (expression: string): boolean => {
try {
eval(expression);
return true;
} catch (error) {
return false;
}
};

console.log(checkMathExpression("5 + 6 / 7 - 4"));
console.log(checkMathExpression("5 a 6"));

0 comments on commit fb54a84

Please sign in to comment.