From b978835251bc28245684062ce9fb0659c6990ce9 Mon Sep 17 00:00:00 2001 From: Florian Schmid Date: Wed, 19 Apr 2023 22:06:05 +0200 Subject: [PATCH] make method private --- js/cpuRepository.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/cpuRepository.js b/js/cpuRepository.js index ec57ae7..5b725fd 100644 --- a/js/cpuRepository.js +++ b/js/cpuRepository.js @@ -21,15 +21,14 @@ export class CpuRepository { } getRandomCpu() { - let randomIndex = this.getRandomInt(0, this.#cpuList.length); + let randomIndex = this.#getRandomInt(0, this.#cpuList.length); this.#cpuList[randomIndex]["name"] = this.#cpuList[randomIndex]["name"].split('@')[0]; return this.#cpuList[randomIndex]; } - getRandomInt(min, max) { + #getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min) + min); // The maximum is exclusive and the minimum is inclusive } - } \ No newline at end of file