Cannot read ' push ' of undefined help me please

i want add new item to this array but push cannot work
pages: Array<{title: any, component: any}>;

this.pages.push({title: user , component: “danger” });
error : cannot read ’ push ’ of undefined

please help me to find solution
thank you

You need to initialize your pages array before you use it.


Thank you very much
he is working