Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
public numbers: number[] = [5, 69, 9];
public add(): void {
const random: number = Math.floor(Math.random() * 100);
this.numbers.push(random);
}
public edit(): void {
const random: number = Math.floor(Math.random() * 100);
this.numbers[0] = random;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.