calculator - javascript - How do I calculate an JavaScript expression called inside a string? -


i creating simple calculator in html , i've created input field. can type there sum , must calculated. only, don't know how...
example:
have string:

234-231*math.sqrt(9) 

is there way calculate sum inside string using javascript?

use eval() function. so: eval("234-231*sqrt(9)");


Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -