- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
The void keyword
The syntax of the void can be either of the following two −
The eval() function
Here’s how you can implement eval() function −
<html> <body> <script> var a = 30; var b = 12; var res1 = eval("a * b") + "<br>"; var res2 = eval("5 + 10") + "<br>"; document.write(res1); document.write(res2); </script> </body> </html>
You can try to run the following code to learn how to work with function() constructor −
<html> <body> <script> var num = new Function('p', 'q', 'r', 'return p * q * r'); document.write("Value after multiplication: "+num(5, 2, 9)); </script> </body> </html>
Value after multiplication: 90
- What is the difference between public, static and void keywords in C#?
- What is the main difference between objects created using object literal and constructor function?
- What is the difference between getter/setter methods and constructor in Java?