Could anyone make me understand the below scenario because I tried searching the web and unable to find any info.
I have the below code which does not work because infox is null. But when i change it "infox: []" then it works fine. I need to understand why is it so ?
data:{
infox:null
}
methods: {
loadmore: function () {
axios.get(this.url)
this.infox.push(...response.data);
}}
Next I want to understand what does the three dot stands for in ...response.data and why I cannot code in the below manner without three dots which makes more sense. I would really appreciate if you could point me to the source.
methods: {
loadmore: function () {
axios.get(this.url)
this.infox.push(response.data);
}}
Below is my JSON data
[
{
"Categories": "Fashion",
"Clicked": 30,
"EndDate": "2019-08-21",
"HomepageSpotlight": "No",
"ImageMainPage": "/static/images/fashion16.jpg",
"MainPage": "Yes",
"Mainhomepage": "No",
"Rating": 5,
"SlugTitle": "buy-clothes-with-50-Off",
},
{
"Categories": "Fashion",
"Clicked": 145,
"EndDate": "2019-08-21",
"HomepageSpotlight": "No",
"ImageMainPage": "/static/images/fashion10.jpg",
"MainPage": "Yes",
"Mainhomepage": "No",
"SlugTitle": "get-upto-60-off-on-jeans",
}
]