“JavaScript Parse PHP Code” Kode Jawaban

Variabel PHP Akses JavaScript

//passing PHP variable to JavaScript
var myJSVar = <?php echo json_encode($myPHPVar); ?>;
Grepper

JavaScript Parse PHP Code

let cars = [
    {
        "id": 1,
        "code": "C1",
        "color": "purple",
        "type": "minivan",
        "registration": new Date('2017-01-03'),
        "capacity": 7
    },
    {
        "id": 2,
        "code": "C2",
        "color": "red",
        "type": "station wagon",
        "registration": new Date('2018-03-03'),
        "capacity": 5
    },
    {
        "id": 3,
        "code": "C2",
        "color": "black",
        "type": "station",
        "registration": new Date('2018-03-03'),
        "capacity": 9
    }
]
const s = new Set()
cars.forEach((element) => {
    console.log(element.id)
    console.log(s.has(element.code) ? 0 : element.code)
    s.add(element.code)
    console.log(element.color)
    console.log(element.type)
    console.log(element.capacity)
});
Cautious Centipede

Jawaban yang mirip dengan “JavaScript Parse PHP Code”

Pertanyaan yang mirip dengan “JavaScript Parse PHP Code”

Lebih banyak jawaban terkait untuk “JavaScript Parse PHP Code” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya