Last active
June 30, 2019 16:28
-
-
Save ssougnez/916c7691dc2c1045fa372a378e6ca6c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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