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

148
Views
Do javascript/react have double arrow operator inside array?

I have array like this:

const arr2 = [
    one => {
      'Hello';
    },
    two => {
      'Answer';
    },
    three => {
      'LOREM IPSUM';
    },
  ];

If javascript have arrow operator inside array then how can i push value at one or at two.

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

0

const arr2 = [
    one => {
      'Hello';
    },
    two => {
      'Answer';
    },
    three => {
      'LOREM IPSUM';
    },
  ];

The one above is basically an array of arrow functions.

so if you do arr2[0] it will print

one => {
      'Hello';
    }

If you wanna do normal push and pop, you can do the same as what you do with arrays in JS

But by your question of double arrow operator , im assuming you wanna have to change values at particular index.

You can always do by arr2[1] = someFunc you wanna assign

Update:

this is what i did and this is the console.log for the same:

const arr2 = [
    one => {
      'Hello';
    },
    two => {
      'Answer';
    },
    three => {
      'LOREM IPSUM';
    },
  ];
  
  arr2.push("hey")
  arr2[1] = "what is this even"
  
  console.log(arr2)

/** [one => {
    'Hello';
  }, "what is this even", three => {
    'LOREM IPSUM';
  }, "hey"] **/

Hope it clears :)

Do let me know in case if any concerns

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!