How can I assign the value of the variable 5 in Array(5) to another variable in this code?
My goal:
export class HelloComponent {
@Input() page: number;
active = 0;
pages;
constructor() {
this.pages = Array(this.page) // instead of Array(5)
.fill(0)
.map((x, i) => i);
this.pages.pop();
}
get currentPage() {
return this.active;
}
}
Check out the stackblitz link for more details.