From 918c3f0dd6446f440e98e77ccec723bc81abe69d Mon Sep 17 00:00:00 2001 From: Stefan Fejes Date: Sat, 17 Oct 2020 17:02:37 +0200 Subject: [PATCH] clean code is good code --- snippets/toRGBObject.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snippets/toRGBObject.md b/snippets/toRGBObject.md index 5901c1f01..200777f31 100644 --- a/snippets/toRGBObject.md +++ b/snippets/toRGBObject.md @@ -11,11 +11,11 @@ Converts an `rgb()` color string to an object with the values of each color. ```js const toRGBObject = rgbStr => { - const [r, g, b] = rgbStr.match(/\d+/g).map(Number); - return { r, g, b }; + const [red, green, blue] = rgbStr.match(/\d+/g).map(Number); + return { red, green, blue }; }; ``` ```js -toRGBObject('rgb(255,12,0)'); // {r: 255, g: 12, b: 0} +toRGBObject("rgb(255,12,0)"); // {red: 255, green: 12, blue: 0} ```