- 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
Here, str can be an expression, variable or statement(s).
Let’s say the following is our array −
var studentMarks = [76,34,56,78,81,98,90,59,64];
Now, fetch a specific value with eval(). Here, we are fetching the value at index 1 −
var studentMarks = [76,34,56,78,81,98,90,59,64]; var stringValue = eval("studentMarks"); console.log(stringValue);
To run the above program, you need to use the following command −
Here, my file name is demo80.js.
This will produce the following output −
- MongoDB aggregation to fetch documents with specific field value?
- Fetch a specific column value (name) in MySQL
- Fetch the value for a specific key in Java IdentityHashMap
- Query an array in MongoDB to fetch a specific value
- Match MongoDB documents with field value greater than a specific number and fetch them?
- PHP fetch a specific value that begins with a given number from a string with letters and numbers?
- Fetch a specific document in MongoDB with array elements
- MongoDB query to fetch a specific document rom documents with field value set using NumberInt()?
- How to query MongoDB a value with $lte, $in and $not to fetch specific values?
- Fetch specific documents with array values in MongoD
- Fetch data between two dates and with a specific value in MongoDB. Group and get the sum with count?