Here's an example of a basic calculator in JavaScript:
index.tsx458 chars20 lines
This prompts the user to enter two numbers and an operator (+, -, *, or /) to perform the operation. Based on the operator entered, the code performs the corresponding calculation and outputs the result to the console.
gistlibby LogSnag