Explain Eval

JavaScript related questions should go here.
Post Reply
unemployment
Posts: 165
Joined: Fri May 06, 2011 5:02 pm

Explain Eval

Post by unemployment »

What does eval do? How is it used?
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Explain Eval

Post by jacek »

it evaluates the given javascript code. In simple terms, it processes (or runs) the code you give it as a string
eval('alert("test");');
it the same as
alert("test");
effectively.
Image
Post Reply