“Metode entri javascript ()” Kode Jawaban

Object.Entries dalam JavaScript

// Object.entries() in javascript
const credits = { producer: 'John', director: 'Jane', assistant: 'Peter' };
const arr = Object.entries(credits);
console.log(arr);

/** Output:
[ [ 'producer', 'John' ],
  [ 'director', 'Jane' ],
  [ 'assistant', 'Peter' ]
]
**/
Chetan Nada

Metode entri javascript ()

// List all entries
let text = "";
for (const x of fruits.entries()) {
  text += x;
}
naly moslih

Jawaban yang mirip dengan “Metode entri javascript ()”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya