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

348
Views
Why does JavaScript object constructer prints only the first parameter value
var employee = ["Sam", "John", "Mark", "Peter", "Simon"]

var department = ["Sales", "Marketting", "Operation", "Finance", "Tech"]

var salary  = [40000, 60000, 50000, 60000, 70000]
const data=new Object(department,employee,salary);

console.log(data);

Why only print departments value?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

var employee = ["Sam", "John", "Mark", "Peter", "Simon"]

var department = ["Sales", "Marketting", "Operation", "Finance", "Tech"]

var salary = [40000, 60000, 50000, 60000, 70000] 

const data={department,employee,salary};
console.log(data)

about 4 years ago · Juan Pablo Isaza Report

0

Enclose the values by curly braces

const data = {department, employee, salary};
about 4 years ago · Juan Pablo Isaza 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!