OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to add something to multiple properties with the same name?

  • Thread starter Thread starter gotta stay high all the time
  • Start date Start date
G

gotta stay high all the time

Guest
So i have a list of objects and array like this:

Code:
let chair1 = {role:"", info:""}
let chair2 = {role:"", info:""}
let chair3 = {role:"", info:""}
let chair4 = {role:"", info:""}
let chair5 = {role:"", info:""}
let chair6 = {role:"", info:""}
let chair7 = {role:"", info:""}

let desk = [chair1, chair2, chair3, chair4, chair5, chair6, chair7]

As you can see, all of the objects have the same property "info". How can i add a text to all of them at the same time?

I tried searching up for jQuery documents tho couldn't find much of what i asked there.

<p>So i have a list of objects and array like this:</p>
<pre><code>let chair1 = {role:"", info:""}
let chair2 = {role:"", info:""}
let chair3 = {role:"", info:""}
let chair4 = {role:"", info:""}
let chair5 = {role:"", info:""}
let chair6 = {role:"", info:""}
let chair7 = {role:"", info:""}

let desk = [chair1, chair2, chair3, chair4, chair5, chair6, chair7]
</code></pre>
<p>As you can see, all of the objects have the same property "info". How can i add a text to all of them at the same time?</p>
<p>I tried searching up for jQuery documents tho couldn't find much of what i asked there.</p>
 

Latest posts

H
Replies
0
Views
1
hohohohoho
H
Top