eval(new String('2 + 2')); // returns a String object containing "2 + 2"
eval('2 + 2'); // returns 4
eval() -> is able to evalute the things inside it , like eval(a+b+c) , wher a=3,b=4,c=4 , so eval(a+b+c) = 11
#Perfect if you want to store a mathematical expression without defining the
#variables used:
my_function = "5x**2 + 8x - 2" #I want to define the function cleanly as a
# variable
#insert definition of other varianles here
#insert other code here
def f(x): #Defining the function as the funtion f(x)
return eval(my_function) #Returning my_function with the x in f(x) as x
print(f(0)) #Printing f(0), thereby returning my_function with 0 as x
#Returns -2