Last active
June 26, 2020 06:09
-
-
Save tetra-fox/fb3b051677e79c6f4e446f661ebf0a17 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var rainbow = ["&c", "&6", "&e", "&a", "&b", "&d"]; | |
var rainbowIndex = -1; | |
var text = "text here".split(""); | |
text.map((obj, index) => { | |
if (obj !== " ") rainbowIndex++; | |
if (index > rainbow.length - 1 && index % 6 === 0) rainbowIndex = 0; | |
return rainbow[rainbowIndex] + obj; | |
}).join(""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment