For door

Asked 2 years ago, Updated 2 years ago, 92 views

How do I make this part simple as a for sentence?

for loops javascript

2022-09-20 15:51

1 Answers

Well, that's exactly why circular grammar was born.
I'll show you the simplest of faces.

// define array of objects.
let details = [
    {
        long: 37.3595704,
        lat: 127.105339,
        label: "crime1",
        name: "Rose Nursery",
        markerType: 1,
        timestamp: "2019-03-01 14:21:00",
        person: "name"
    },
];

// While touring the array...
for (i = 0; i < details.length; i++) {

    // Take out the object...
    let detail = details[i];

    // Use the properties.
    markers.push(new CustomMarker(
        detail.long,
        detail.lat,
        detail.label,
        detail.name,
        detail.markerType,
        detail.timestamp,
        detail.person
    ));
}


2022-09-20 15:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.