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

154
Views
How to set google protobuf repeated field in javascript

For example, you have a google protobuf message Customer with repeated field like below.

message Customer {
  repeated int32 items = 1;
} 

How do you set the repeated items field in javascript?

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

0

To set the repeated field in javascript,

You can use either setItemsList or addItems methods.

For example, to use setItemsList method

let customer = new Customer();
customer.setItemsList([12, 123, 1234]);

It will set the value of items to the javascript array.

Or for another example, to use addItems method

let customer = new Customer();
customer.addItems(123);

It will append the value of 123 to the list of items in the message.

For more info, you can check out the protobuf docs for repeated field in javascript.

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!