Object inside of an array
What I want to do is to add an object in array something like code below, but my Ide returns some errors, I don't understand what the problem is
val sachmelebi = [
{
name: 'ხინკალი',
link: 'https://www.google.com/search?q=%E1%83%AE%E1%83%98%E1%83%9C%E1%83%99%E1%83%90%E1%83%9A%E1%83%98&oq=%E1%83%AE%E1%83%98%E1%83%9C%E1%83%99%E1%83%90%E1%83%9A%E1%83%98&aqs=chrome..69i57j46j0l6.1143j0j9&sourceid=chrome&ie=UTF-8'
},
{
name: 'მწვადი',
link: 'https://www.google.com/search?q=%E1%83%9B%E1%83%AC%E1%83%95%E1%83%90%E1%83%93%E1%83%98&oq=%E1%83%9B%E1%83%AC%E1%83%95%E1%83%90%E1%83%93%E1%83%98&aqs=chrome.0.69i59j0l7.983j0j9&sourceid=chrome&ie=UTF-8'
},
{
name: 'მაკარონის წასახემსებელი',
link: 'https://gemrielia.ge/recipe/6594-xraSuna-makaronis-wasaxemsebeli-romelic-wuTebSi-mzaddeba/'
}
The code snippet provided in the question is not valid Kotlin syntax. I would suggest to create a data class
for your entries and then store them in a list. Below you can find an example:
data class Entry( // use a better name than "Entry"
val name: String,
val link: String
)
val sachmelebi = listOf(
Entry(
"ხინკალი",
"https://www.google.com/search?q=%E1%83%AE%E1%83%98%E1%83%9C%E1%83%99%E1%83%90%E1%83%9A%E1%83%98&oq=%E1%83%AE%E1%83%98%E1%83%9C%E1%83%99%E1%83%90%E1%83%9A%E1%83%98&aqs=chrome..69i57j46j0l6.1143j0j9&sourceid=chrome&ie=UTF-8"
),
Entry(
"მწვადი",
"https://www.google.com/search?q=%E1%83%9B%E1%83%AC%E1%83%95%E1%83%90%E1%83%93%E1%83%98&oq=%E1%83%9B%E1%83%AC%E1%83%95%E1%83%90%E1%83%93%E1%83%98&aqs=chrome.0.69i59j0l7.983j0j9&sourceid=chrome&ie=UTF-8"
),
Entry(
"მაკარონის წასახემსებელი",
"https://gemrielia.ge/recipe/6594-xraSuna-makaronis-wasaxemsebeli-romelic-wuTebSi-mzaddeba/"
)
)