Skip to content

Instantly share code, notes, and snippets.

@ssougnez
Last active June 30, 2019 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssougnez/916c7691dc2c1045fa372a378e6ca6c5 to your computer and use it in GitHub Desktop.
Save ssougnez/916c7691dc2c1045fa372a378e6ca6c5 to your computer and use it in GitHub Desktop.
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