Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
How to get the value of iterating object? Without using foreach and dot operator

For example:

var myObject = {
 name : 'David',
 age: '30,
 salary:'30000'
}

I need answers like: My name is David, I'm 30 years old. I earned monthly 30000.

Note: Without using '.' DOT operator and for and foreach.

almost 4 years ago · Santiago Trujillo
3 answers
Answer question

0

This should work:

var myObject = {
    'name' : 'David',
    'age': '30',
    'salary':'30000'
 };
console.log('My name is '+myObject['name']);

Here is the JSFiddle Example: Link

almost 4 years ago · Santiago Trujillo Report

0

var myObject = { name : 'David', age: '30', salary:'30000' } //object destructure

let {name, age, salary} = myObject;

console.log(my name is ${name})

almost 4 years ago · Santiago Trujillo Report

0

var myObject = {
    'name' : 'David',
    'age': '30',
    'salary':'30000'
 };
console.log(`My name is ${myObject["name"]}, I'm ${myObject["age"]} years old. I earned monthly ${myObject['salary']}.`);
almost 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!