Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Svelte Each function in Nested Json

$
0
0

I have nested JSON Array

let car = [{    name: "BMW",    detail: [        {name: headlight, type: flame},        {name: taillight, type: spark},    ],},{    name: "Merced Benz",    detail: [        {name: headlight, type: spark},        {name: taillight, type: flame},    ],},]

it's show cars name when i call{#each car as cars}<p>{cars.name}</p>{/each}

but when i call {cars.detail} its show [object Object]andwhen i call {cars.detail.name} its show Undefined

i wanna call each name of detail

please help me to use this each function at svelte thank you before


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>