You can download the full list of emoji from here (v14.0). Then you can place the emojis into an array and return an element from a random position.
Example:
javascriptconst getRandomEmoji = () => { const emojis = ['😀','😃','😄','😁','😆','😅','🤣','😂','🙂','🙃','🫠','😉','😊','😇','🥰','😍','🤩','😘','😗','☺','😚','😙','🥲','😋','😛','😜','🤪','😝','🤑','🤗','🤭','🫢','🫣','🤫','🤔','🫡','🤐','🤨','😐','😑','😶','🫥','😶🌫️','😏','😒','🙄','😬','😮💨','🤥','😌','😔','😪','🤤','😴','😷','🤒','🤕','🤢','🤮','🤧','🥵','🥶','🥴','😵','😵💫','🤯','🤠','🥳','🥸','😎','🤓','🧐','😕','🫤','😟','🙁','☹','😮','😯','😲','😳','🥺','🥹','😦','😧','😨','😰','😥','😢','😭','😱','😖','😣','😞','😓','😩','😫','🥱','😤','😡','😠','🤬','😈','👿','💀','☠','💩','🤡','👹','👺','👻','👽','👾','🤖','😺','😸','😹','😻','😼','😽','🙀','😿','😾','🙈','🙉','🙊','💋','💌','💘','💝','💖','💗','💓','💞','💕','💟','❣','💔','❤️🔥','❤️🩹','❤','🧡','💛','💚','💙','💜','🤎','🖤','🤍','💯','💢','💥','💫','💦','💨','🕳','💣','💬','👁️🗨️','🗨','🗯','💭','💤','👋','🤚','🖐','✋','🖖','🫱','🫲','🫳','🫴','👌','🤌','🤏','✌','🤞','🫰','🤟','🤘','🤙','👈','👉','👆','🖕','👇','☝','🫵','👍','👎','✊','👊','🤛','🤜','👏','🙌','🫶','👐','🤲','🤝','🙏','✍','💅','🤳','💪','🦾','🦿','🦵','🦶','👂','🦻','👃','🧠','🫀','🫁','🦷','🦴','👀','👁','👅','👄','🫦','👶','🧒','👦','👧','🧑','👱','👨','🧔','🧔♂️','🧔♀️','👨🦰','👨🦱','👨🦳','👨🦲','👩','👩🦰','🧑🦰','👩🦱','🧑🦱','👩🦳','🧑🦳','👩🦲','🧑🦲','👱♀️','👱♂️','🧓','👴','👵','🙍','🙍♂️','🙍♀️','🙎','🙎♂️','🙎♀️','🙅','🙅♂️','🙅♀️','🙆','🙆♂️','🙆♀️','💁','💁♂️','💁♀️','🙋','🙋♂️','🙋♀️','🧏','🧏♂️','🧏♀️','🙇','🙇♂️','🙇♀️','🤦','🤦♂️','🤦♀️','🤷','🤷♂️','🤷♀️','🧑⚕️','👨⚕️','👩⚕️','🧑🎓','👨🎓','👩🎓','🧑🏫','👨🏫','👩🏫','🧑⚖️','👨⚖️','👩⚖️','🧑🌾','👨🌾','👩🌾','🧑🍳','👨🍳','👩🍳','🧑🔧','👨🔧','👩🔧','🧑🏭','👨🏭','👩🏭','🧑💼','👨💼','👩💼','🧑🔬','👨🔬','👩🔬','🧑💻','👨💻','👩💻','🧑🎤','👨🎤','👩🎤','🧑🎨','👨🎨','👩🎨','🧑✈️','👨✈️','👩✈️','🧑🚀','👨🚀','👩🚀','🧑🚒','👨🚒','👩🚒','👮','👮♂️','👮♀️','🕵','🕵️♂️','🕵️♀️','💂','💂♂️','💂♀️','🥷','👷','👷♂️','👷♀️','🫅','🤴','👸','👳','👳♂️','👳♀️','👲','🧕','🤵','🤵♂️','🤵♀️','👰','👰♂️','👰♀️','🤰','🫃','🫄','🤱','👩🍼','👨🍼','🧑🍼','👼','🎅','🤶','🧑🎄','🦸','🦸♂️','🦸♀️','🦹','🦹♂️','🦹♀️','🧙','🧙♂️','🧙♀️','🧚','🧚♂️','🧚♀️','🧛','🧛♂️','🧛♀️','🧜','🧜♂️','🧜♀️','🧝','🧝♂️','🧝♀️','🧞','🧞♂️','🧞♀️','🧟','🧟♂️','🧟♀️','🧌','💆','💆♂️','💆♀️','💇','💇♂️','💇♀️','🚶','🚶♂️','🚶♀️','🧍','🧍♂️','🧍♀️','🧎','🧎♂️','🧎♀️','🧑🦯','👨🦯','👩🦯','🧑🦼','👨🦼','👩🦼','🧑🦽','👨🦽','👩🦽','🏃','🏃♂️','🏃♀️','💃','🕺','🕴','👯','👯♂️','👯♀️','🧖','🧖♂️','🧖♀️','🧗','🧗♂️','🧗♀️','🤺','🏇','⛷','🏂','🏌','🏌️♂️','🏌️♀️','🏄','🏄♂️','🏄♀️','🚣','🚣♂️','🚣♀️','🏊','🏊♂️','🏊♀️','⛹','⛹️♂️','⛹️♀️','🏋','🏋️♂️','🏋️♀️','🚴','🚴♂️','🚴♀️','🚵','🚵♂️','🚵♀️','🤸','🤸♂️','🤸♀️','🤼','🤼♂️','🤼♀️','🤽','🤽♂️','🤽♀️','🤾','🤾♂️','🤾♀️','🤹','🤹♂️','🤹♀️','🧘','🧘♂️','🧘♀️','🛀','🛌','🧑🤝🧑','👭','👫','👬','💏','👩❤️💋👨','👨❤️💋👨','👩❤️💋👩','💑','👩❤️👨','👨❤️👨','👩❤️👩','👪','👨👩👦','👨👩👧','👨👩👧👦','👨👩👦👦','👨👩👧👧','👨👨👦','👨👨👧','👨👨👧👦','👨👨👦👦','👨👨👧👧','👩👩👦','👩👩👧','👩👩👧👦','👩👩👦👦','👩👩👧👧','👨👦','👨👦👦','👨👧','👨👧👦','👨👧👧','👩👦','👩👦👦','👩👧','👩👧👦','👩👧👧','🗣','👤','👥','🫂','👣','🦰','🦱','🦳','🦲','🐵','🐒','🦍','🦧','🐶','🐕','🦮','🐕🦺','🐩','🐺','🦊','🦝','🐱','🐈','🐈⬛','🦁','🐯','🐅','🐆','🐴','🐎','🦄','🦓','🦌','🦬','🐮','🐂','🐃','🐄','🐷','🐖','🐗','🐽','🐏','🐑','🐐','🐪','🐫','🦙','🦒','🐘','🦣','🦏','🦛','🐭','🐁','🐀','🐹','🐰','🐇','🐿','🦫','🦔','🦇','🐻','🐻❄️','🐨','🐼','🦥','🦦','🦨','🦘','🦡','🐾','🦃','🐔','🐓','🐣','🐤','🐥','🐦','🐧','🕊','🦅','🦆','🦢','🦉','🦤','🪶','🦩','🦚','🦜','🐸','🐊','🐢','🦎','🐍','🐲','🐉','🦕','🦖','🐳','🐋','🐬','🦭','🐟','🐠','🐡','🦈','🐙','🐚','🪸','🐌','🦋','🐛','🐜','🐝','🪲','🐞','🦗','🪳','🕷','🕸','🦂','🦟','🪰','🪱','🦠','💐','🌸','💮','🪷','🏵','🌹','🥀','🌺','🌻','🌼','🌷','🌱','🪴','🌲','🌳','🌴','🌵','🌾','🌿','☘','🍀','🍁','🍂','🍃','🪹','🪺','🍇','🍈','🍉','🍊','🍋','🍌','🍍','🥭','🍎','🍏','🍐','🍑','🍒','🍓','🫐','🥝','🍅','🫒','🥥','🥑','🍆','🥔','🥕','🌽','🌶','🫑','🥒','🥬','🥦','🧄','🧅','🍄','🥜','🫘','🌰','🍞','🥐','🥖','🫓','🥨','🥯','🥞','🧇','🧀','🍖','🍗','🥩','🥓','🍔','🍟','🍕','🌭','🥪','🌮','🌯','🫔','🥙','🧆','🥚','🍳','🥘','🍲','🫕','🥣','🥗','🍿','🧈','🧂','🥫','🍱','🍘','🍙','🍚','🍛','🍜','🍝','🍠','🍢','🍣','🍤','🍥','🥮','🍡','🥟','🥠','🥡','🦀','🦞','🦐','🦑','🦪','🍦','🍧','🍨','🍩','🍪','🎂','🍰','🧁','🥧','🍫','🍬','🍭','🍮','🍯','🍼','🥛','☕','🫖','🍵','🍶','🍾','🍷','🍸','🍹','🍺','🍻','🥂','🥃','🫗','🥤','🧋','🧃','🧉','🧊','🥢','🍽','🍴','🥄','🔪','🫙','🏺','🌍','🌎','🌏','🌐','🗺','🗾','🧭','🏔','⛰','🌋','🗻','🏕','🏖','🏜','🏝','🏞','🏟','🏛','🏗','🧱','🪨','🪵','🛖','🏘','🏚','🏠','🏡','🏢','🏣','🏤','🏥','🏦','🏨','🏩','🏪','🏫','🏬','🏭','🏯','🏰','💒','🗼','🗽','⛪','🕌','🛕','🕍','⛩','🕋','⛲','⛺','🌁','🌃','🏙','🌄','🌅','🌆','🌇','🌉','♨','🎠','🛝','🎡','🎢','💈','🎪','🚂','🚃','🚄','🚅','🚆','🚇','🚈','🚉','🚊','🚝','🚞','🚋','🚌','🚍','🚎','🚐','🚑','🚒','🚓','🚔','🚕','🚖','🚗','🚘','🚙','🛻','🚚','🚛','🚜','🏎','🏍','🛵','🦽','🦼','🛺','🚲','🛴','🛹','🛼','🚏','🛣','🛤','🛢','⛽','🛞','🚨','🚥','🚦','🛑','🚧','⚓','🛟','⛵','🛶','🚤','🛳','⛴','🛥','🚢','✈','🛩','🛫','🛬','🪂','💺','🚁','🚟','🚠','🚡','🛰','🚀','🛸','🛎','🧳','⌛','⏳','⌚','⏰','⏱','⏲','🕰','🕛','🕧','🕐','🕜','🕑','🕝','🕒','🕞','🕓','🕟','🕔','🕠','🕕','🕡','🕖','🕢','🕗','🕣','🕘','🕤','🕙','🕥','🕚','🕦','🌑','🌒','🌓','🌔','🌕','🌖','🌗','🌘','🌙','🌚','🌛','🌜','🌡','☀','🌝','🌞','🪐','⭐','🌟','🌠','🌌','☁','⛅','⛈','🌤','🌥','🌦','🌧','🌨','🌩','🌪','🌫','🌬','🌀','🌈','🌂','☂','☔','⛱','⚡','❄','☃','⛄','☄','🔥','💧','🌊','🎃','🎄','🎆','🎇','🧨','✨','🎈','🎉','🎊','🎋','🎍','🎎','🎏','🎐','🎑','🧧','🎀','🎁','🎗','🎟','🎫','🎖','🏆','🏅','🥇','🥈','🥉','⚽','⚾','🥎','🏀','🏐','🏈','🏉','🎾','🥏','🎳','🏏','🏑','🏒','🥍','🏓','🏸','🥊','🥋','🥅','⛳','⛸','🎣','🤿','🎽','🎿','🛷','🥌','🎯','🪀','🪁','🎱','🔮','🪄','🧿','🪬','🎮','🕹','🎰','🎲','🧩','🧸','🪅','🪩','🪆','♠','♥','♦','♣','♟','🃏','🀄','🎴','🎭','🖼','🎨','🧵','🪡','🧶','🪢','👓','🕶','🥽','🥼','🦺','👔','👕','👖','🧣','🧤','🧥','🧦','👗','👘','🥻','🩱','🩲','🩳','👙','👚','👛','👜','👝','🛍','🎒','🩴','👞','👟','🥾','🥿','👠','👡','🩰','👢','👑','👒','🎩','🎓','🧢','🪖','⛑','📿','💄','💍','💎','🔇','🔈','🔉','🔊','📢','📣','📯','🔔','🔕','🎼','🎵','🎶','🎙','🎚','🎛','🎤','🎧','📻','🎷','🪗','🎸','🎹','🎺','🎻','🪕','🥁','🪘','📱','📲','☎','📞','📟','📠','🔋','🪫','🔌','💻','🖥','🖨','⌨','🖱','🖲','💽','💾','💿','📀','🧮','🎥','🎞','📽','🎬','📺','📷','📸','📹','📼','🔍','🔎','🕯','💡','🔦','🏮','🪔','📔','📕','📖','📗','📘','📙','📚','📓','📒','📃','📜','📄','📰','🗞','📑','🔖','🏷','💰','🪙','💴','💵','💶','💷','💸','💳','🧾','💹','✉','📧','📨','📩','📤','📥','📦','📫','📪','📬','📭','📮','🗳','✏','✒','🖋','🖊','🖌','🖍','📝','💼','📁','📂','🗂','📅','📆','🗒','🗓','📇','📈','📉','📊','📋','📌','📍','📎','🖇','📏','📐','✂','🗃','🗄','🗑','🔒','🔓','🔏','🔐','🔑','🗝','🔨','🪓','⛏','⚒','🛠','🗡','⚔','🔫','🪃','🏹','🛡','🪚','🔧','🪛','🔩','⚙','🗜','⚖','🦯','🔗','⛓','🪝','🧰','🧲','🪜','⚗','🧪','🧫','🧬','🔬','🔭','📡','💉','🩸','💊','🩹','🩼','🩺','🩻','🚪','🛗','🪞','🪟','🛏','🛋','🪑','🚽','🪠','🚿','🛁','🪤','🪒','🧴','🧷','🧹','🧺','🧻','🪣','🧼','🫧','🪥','🧽','🧯','🛒','🚬','⚰','🪦','⚱','🗿','🪧','🪪','🏧','🚮','🚰','♿','🚹','🚺','🚻','🚼','🚾','🛂','🛃','🛄','🛅','⚠','🚸','⛔','🚫','🚳','🚭','🚯','🚱','🚷','📵','🔞','☢','☣','⬆','↗','➡','↘','⬇','↙','⬅','↖','↕','↔','↩','↪','⤴','⤵','🔃','🔄','🔙','🔚','🔛','🔜','🔝','🛐','⚛','🕉','✡','☸','☯','✝','☦','☪','☮','🕎','🔯','♈','♉','♊','♋','♌','♍','♎','♏','♐','♑','♒','♓','⛎','🔀','🔁','🔂','▶','⏩','⏭','⏯','◀','⏪','⏮','🔼','⏫','🔽','⏬','⏸','⏹','⏺','⏏','🎦','🔅','🔆','📶','📳','📴','♀','♂','⚧','✖','➕','➖','➗','🟰','♾','‼','⁉','❓','❔','❕','❗','〰','💱','💲','⚕','♻','⚜','🔱','📛','🔰','⭕','✅','☑','✔','❌','❎','➰','➿','〽','✳','✴','❇','©','®','™','#️⃣','*️⃣','0️⃣','1️⃣','2️⃣','3️⃣','4️⃣','5️⃣','6️⃣','7️⃣','8️⃣','9️⃣','🔟','🔠','🔡','🔢','🔣','🔤','🅰','🆎','🅱','🆑','🆒','🆓','ℹ','🆔','Ⓜ','🆕','🆖','🅾','🆗','🅿','🆘','🆙','🆚','🈁','🈂','🈷','🈶','🈯','🉐','🈹','🈚','🈲','🉑','🈸','🈴','🈳','㊗','㊙','🈺','🈵','🔴','🟠','🟡','🟢','🔵','🟣','🟤','⚫','⚪','🟥','🟧','🟨','🟩','🟦','🟪','🟫','⬛','⬜','◼','◻','◾','◽','▪','▫','🔶','🔷','🔸','🔹','🔺','🔻','💠','🔘','🔳','🔲','🏁','🚩','🎌','🏴','🏳','🏳️🌈','🏳️⚧️','🏴☠️','🇦🇨','🇦🇩','🇦🇪','🇦🇫','🇦🇬','🇦🇮','🇦🇱','🇦🇲','🇦🇴','🇦🇶','🇦🇷','🇦🇸','🇦🇹','🇦🇺','🇦🇼','🇦🇽','🇦🇿','🇧🇦','🇧🇧','🇧🇩','🇧🇪','🇧🇫','🇧🇬','🇧🇭','🇧🇮','🇧🇯','🇧🇱','🇧🇲','🇧🇳','🇧🇴','🇧🇶','🇧🇷','🇧🇸','🇧🇹','🇧🇻','🇧🇼','🇧🇾','🇧🇿','🇨🇦','🇨🇨','🇨🇩','🇨🇫','🇨🇬','🇨🇭','🇨🇮','🇨🇰','🇨🇱','🇨🇲','🇨🇳','🇨🇴','🇨🇵','🇨🇷','🇨🇺','🇨🇻','🇨🇼','🇨🇽','🇨🇾','🇨🇿','🇩🇪','🇩🇬','🇩🇯','🇩🇰','🇩🇲','🇩🇴','🇩🇿','🇪🇦','🇪🇨','🇪🇪','🇪🇬','🇪🇭','🇪🇷','🇪🇸','🇪🇹','🇪🇺','🇫🇮','🇫🇯','🇫🇰','🇫🇲','🇫🇴','🇫🇷','🇬🇦','🇬🇧','🇬🇩','🇬🇪','🇬🇫','🇬🇬','🇬🇭','🇬🇮','🇬🇱','🇬🇲','🇬🇳','🇬🇵','🇬🇶','🇬🇷','🇬🇸','🇬🇹','🇬🇺','🇬🇼','🇬🇾','🇭🇰','🇭🇲','🇭🇳','🇭🇷','🇭🇹','🇭🇺','🇮🇨','🇮🇩','🇮🇪','🇮🇱','🇮🇲','🇮🇳','🇮🇴','🇮🇶','🇮🇷','🇮🇸','🇮🇹','🇯🇪','🇯🇲','🇯🇴','🇯🇵','🇰🇪','🇰🇬','🇰🇭','🇰🇮','🇰🇲','🇰🇳','🇰🇵','🇰🇷','🇰🇼','🇰🇾','🇰🇿','🇱🇦','🇱🇧','🇱🇨','🇱🇮','🇱🇰','🇱🇷','🇱🇸','🇱🇹','🇱🇺','🇱🇻','🇱🇾','🇲🇦','🇲🇨','🇲🇩','🇲🇪','🇲🇫','🇲🇬','🇲🇭','🇲🇰','🇲🇱','🇲🇲','🇲🇳','🇲🇴','🇲🇵','🇲🇶','🇲🇷','🇲🇸','🇲🇹','🇲🇺','🇲🇻','🇲🇼','🇲🇽','🇲🇾','🇲🇿','🇳🇦','🇳🇨','🇳🇪','🇳🇫','🇳🇬','🇳🇮','🇳🇱','🇳🇴','🇳🇵','🇳🇷','🇳🇺','🇳🇿','🇴🇲','🇵🇦','🇵🇪','🇵🇫','🇵🇬','🇵🇭','🇵🇰','🇵🇱','🇵🇲','🇵🇳','🇵🇷','🇵🇸','🇵🇹','🇵🇼','🇵🇾','🇶🇦','🇷🇪','🇷🇴','🇷🇸','🇷🇺','🇷🇼','🇸🇦','🇸🇧','🇸🇨','🇸🇩','🇸🇪','🇸🇬','🇸🇭','🇸🇮','🇸🇯','🇸🇰','🇸🇱','🇸🇲','🇸🇳','🇸🇴','🇸🇷','🇸🇸','🇸🇹','🇸🇻','🇸🇽','🇸🇾','🇸🇿','🇹🇦','🇹🇨','🇹🇩','🇹🇫','🇹🇬','🇹🇭','🇹🇯','🇹🇰','🇹🇱','🇹🇲','🇹🇳','🇹🇴','🇹🇷','🇹🇹','🇹🇻','🇹🇼','🇹🇿','🇺🇦','🇺🇬','🇺🇲','🇺🇳','🇺🇸','🇺🇾','🇺🇿','🇻🇦','🇻🇨','🇻🇪','🇻🇬','🇻🇮','🇻🇳','🇻🇺','🇼🇫','🇼🇸','🇽🇰','🇾🇪','🇾🇹','🇿🇦','🇿🇲','🇿🇼','🏴','🏴','🏴'] return emojis[~~(Math.random() * emojis.length)] }
You could also categorize and subcategorize the emojis to create a more complete function:
javascriptconst getRandomEmoji = (cat, sub) => { let emojis = { 'Smileys & Emotion': { 'face-smiling':['😀','😃','😄','😁','😆','😅','🤣','😂','🙂','🙃','🫠','😉','😊','😇'], 'face-affection':['🥰','😍','🤩','😘','😗','☺','😚','😙','🥲'], 'face-tongue':['😋','😛','😜','🤪','😝','🤑'], 'face-hand':['🤗','🤭','🫢','🫣','🤫','🤔','🫡'], 'face-neutral-skeptical':['🤐','🤨','😐','😑','😶','🫥','😶🌫️','😏','😒','🙄','😬','😮💨','🤥'], 'face-sleepy':['😌','😔','😪','🤤','😴'], 'face-unwell':['😷','🤒','🤕','🤢','🤮','🤧','🥵','🥶','🥴','😵','😵💫','🤯'], 'face-hat':['🤠','🥳','🥸'], 'face-glasses':['😎','🤓','🧐'], 'face-concerned':['😕','🫤','😟','🙁','☹','😮','😯','😲','😳','🥺','🥹','😦','😧','😨','😰','😥','😢','😭','😱','😖','😣','😞','😓','😩','😫','🥱'], 'face-negative':['😤','😡','😠','🤬','😈','👿','💀','☠'], 'face-costume':['💩','🤡','👹','👺','👻','👽','👾','🤖'], 'cat-face':['😺','😸','😹','😻','😼','😽','🙀','😿','😾'], 'monkey-face':['🙈','🙉','🙊'], 'emotion':['💋','💌','💘','💝','💖','💗','💓','💞','💕','💟','❣','💔','❤️🔥','❤️🩹','❤','🧡','💛','💚','💙','💜','🤎','🖤','🤍','💯','💢','💥','💫','💦','💨','🕳','💣','💬','👁️🗨️','🗨','🗯','💭','💤'], }, 'People & Body': { 'hand-fingers-open':['👋','🤚','🖐','✋','🖖','🫱','🫲','🫳','🫴'], 'hand-fingers-partial':['👌','🤌','🤏','✌','🤞','🫰','🤟','🤘','🤙'], 'hand-single-finger':['👈','👉','👆','🖕','👇','☝','🫵'], 'hand-fingers-closed':['👍','👎','✊','👊','🤛','🤜'], 'hands':['👏','🙌','🫶','👐','🤲','🤝','🙏'], 'hand-prop':['✍','💅','🤳'], 'body-parts':['💪','🦾','🦿','🦵','🦶','👂','🦻','👃','🧠','🫀','🫁','🦷','🦴','👀','👁','👅','👄','🫦'], 'person':['👶','🧒','👦','👧','🧑','👱','👨','🧔','🧔♂️','🧔♀️','👨🦰','👨🦱','👨🦳','👨🦲','👩','👩🦰','🧑🦰','👩🦱','🧑🦱','👩🦳','🧑🦳','👩🦲','🧑🦲','👱♀️','👱♂️','🧓','👴','👵'], 'person-gesture':['🙍','🙍♂️','🙍♀️','🙎','🙎♂️','🙎♀️','🙅','🙅♂️','🙅♀️','🙆','🙆♂️','🙆♀️','💁','💁♂️','💁♀️','🙋','🙋♂️','🙋♀️','🧏','🧏♂️'], 'person-role':['🧑⚕️','👨⚕️','👩⚕️','🧑🎓','👨🎓','👩🎓','🧑🏫','👨🏫','👩🏫','🧑⚖️','👨⚖️','👩⚖️','🧑🌾','👨🌾','👩🌾','🧑🍳','👨🍳','👩🍳','🧑🔧','👨🔧','👩🔧','🧑🏭','👨🏭','👩🏭','🧑💼','👨💼','👩💼','🧑🔬','👨🔬','👩🔬','🧑💻','👨💻','👩💻','🧑🎤','👨🎤','👩🎤','🧑🎨','👨🎨','👩🎨','🧑✈️','👨✈️','👩✈️','🧑🚀','👨🚀','👩🚀','🧑🚒','👨🚒','👩🚒','👮','👮♂️','👮♀️','🕵','🕵️♂️','🕵️♀️','💂','💂♂️','💂♀️','🥷','👷','👷♂️','👷♀️','🫅','🤴','👸','👳','👳♂️','👳♀️','👲','🧕','🤵','🤵♂️','🤵♀️','👰','👰♂️','👰♀️','🤰','🫃','🫄','🤱','👩🍼','👨🍼','🧑🍼'], 'person-fantasy':['👼','🎅','🤶','🧑🎄','🦸','🦸♂️','🦸♀️','🦹','🦹♂️','🦹♀️','🧙','🧙♂️','🧙♀️','🧚','🧚♂️','🧚♀️','🧛','🧛♂️','🧛♀️','🧜','🧜♂️','🧜♀️','🧝','🧝♂️','🧝♀️','🧞','🧞♂️','🧞♀️','🧟','🧟♂️','🧟♀️','🧌'], 'person-activity':['💆','💆♂️','💆♀️','💇','💇♂️','💇♀️','🚶','🚶♂️','🚶♀️','🧍','🧍♂️','🧍♀️','🧎','🧎♂️','🧎♀️','🧑🦯','👨🦯','👩🦯','🧑🦼','👨🦼','👩🦼','🧑🦽','👨🦽','👩🦽','🏃','🏃♂️','🏃♀️','💃','🕺','🕴','👯','👯♂️','👯♀️','🧖','🧖♂️','🧖♀️','🧗','🧗♂️','🧗♀️'], 'person-sport':['🤺','🏇','⛷','🏂','🏌','🏌️♂️','🏌️♀️','🏄','🏄♂️','🏄♀️','🚣','🚣♂️','🚣♀️','🏊','🏊♂️','🏊♀️','⛹','⛹️♂️','⛹️♀️','🏋','🏋️♂️','🏋️♀️','🚴','🚴♂️','🚴♀️','🚵','🚵♂️','🚵♀️','🤸','🤸♂️','🤸♀️','🤼','🤼♂️','🤼♀️','🤽','🤽♂️','🤽♀️','🤾','🤾♂️','🤾♀️','🤹','🤹♂️','🤹♀️'], 'person-resting':['🧘','🧘♂️','🧘♀️','🛀','🛌'], 'family':['🧑🤝🧑','👭','👫','👬','💏','👩❤️💋👨','👨❤️💋👨','👩❤️💋👩','💑','👩❤️👨','👨❤️👨','👩❤️👩','👪','👨👩👦','👨👩👧','👨👩👧👦','👨👩👦👦','👨👩👧👧','👨👨👦','👨👨👧','👨👨👧👦','👨👨👦👦','👨👨👧👧','👩👩👦','👩👩👧','👩👩👧👦','👩👩👦👦','👩👩👧👧','👨👦','👨👦👦','👨👧','👨👧👦','👨👧👧','👩👦','👩👦👦','👩👧','👩👧👦','👩👧👧'], 'person-symbol':['🗣','👤','👥','🫂','👣'] }, 'Component': { 'hair-style':['🦰','🦱','🦳','🦲'] }, 'Animals & Nature': { 'animal-mammal':['🐵','🐒','🦍','🦧','🐶','🐕','🦮','🐕🦺','🐩','🐺','🦊','🦝','🐱','🐈','🐈⬛','🦁','🐯','🐅','🐆','🐴','🐎','🦄','🦓','🦌','🦬','🐮','🐂','🐃','🐄','🐷','🐖','🐗','🐽','🐏','🐑','🐐','🐪','🐫','🦙','🦒','Browser','🐘','🦣','🦏','🦛','🐭','🐁','🐀','🐹','🐰','🐇','🐿','🦫','🦔','🦇','🐻','🐻❄️','🐨','🐼','🦥','🦦','🦨','🦘','🦡','🐾'], 'animal-bird':['🦃','🐔','🐓','🐣','🐤','🐥','🐦','🐧','🕊','🦅','🦆','🦢','🦉','🦤','🪶','🦩','🦚','🦜'], 'animal-amphibian':['🐸'], 'animal-reptile':['🐊','🐢','🦎','🐍','🐲','🐉','🦕','🦖'], 'animal-marine':['🐳','🐋','🐬','🦭','🐟','🐠','🐡','🦈','🐙','🐚','🪸'], 'animal-bug':['🐌','🦋','🐛','🐜','🐝','🪲','🐞','🦗','🪳','🕷','🕸','🦂','🦟','🪰','🪱','🦠'], 'plant-flower':['💐','🌸','💮','🪷','🏵','🌹','🥀','🌺','🌻','🌼','🌷'], 'plant-other':['🌱','🪴','🌲','🌳','🌴','🌵','🌾','🌿','☘','🍀','🍁','🍂','🍃','🪹','🪺'] }, 'Food & Drink': { 'food-fruit':['🍇','🍈','🍉','🍊','🍋','🍌','🍍','🥭','🍎','🍏','🍐','🍑','🍒','🍓','🫐','🥝','🍅','🫒','🥥'], 'food-vegetable':['🥑','🍆','🥔','🥕','🌽','🌶','🫑','🥒','🥬','🥦','🧄','🧅','🍄','🥜','🫘','🌰'], 'food-prepared':['🍞','🥐','🥖','🫓','🥨','🥯','🥞','🧇','🧀','🍖','🍗','🥩','🥓','🍔','🍟','🍕','🌭','🥪','🌮','🌯','🫔','🥙','🧆','🥚','🍳','🥘','🍲','🫕','🥣','🥗','🍿','🧈','🧂','🥫'], 'food-asian':['🍱','🍘','🍙','🍚','🍛','🍜','🍝','🍠','🍢','🍣','🍤','🍥','🥮','🍡','🥟','🥠','🥡'], 'food-marine':['🦀','🦞','🦐','🦑','🦪'], 'food-sweet':['🍦','🍧','🍨','🍩','🍪','🎂','🍰','🧁','🥧','🍫','🍬','🍭','🍮','🍯'], 'drink':['🍼','🥛','☕','🫖','🍵','🍶','🍾','🍷','🍸','🍹','🍺','🍻','🥂','🥃','🫗','🥤','🧋','🧃','🧉','🧊'], 'dishware':['🥢','🍽','🍴','🥄','🔪','🫙','🏺'] }, 'Travel & Places': { 'place-map':['🌍','🌎','🌏','🌐','🗺','🗾','🧭'], 'place-geographic':['🏔','⛰','🌋','🗻','🏕','🏖','🏜','🏝','🏞'], 'place-building':['🏟','🏛','🏗','🧱','🪨','🪵','🛖','🏘','🏚','🏠','🏡','🏢','🏣','🏤','🏥','🏦','🏨','🏩','🏪','🏫','🏬','🏭','🏯','🏰','💒','🗼','🗽'], 'place-religious':['⛪','🕌','🛕','🕍','⛩','🕋'], 'place-other':['⛲','⛺','🌁','🌃','🏙','🌄','🌅','🌆','🌇','🌉','♨','🎠','🛝','🎡','🎢','💈','🎪'], 'transport-ground':['🚂','🚃','🚄','🚅','🚆','🚇','🚈','🚉','🚊','🚝','🚞','🚋','🚌','🚍','🚎','🚐','🚑','🚒','🚓','🚔','🚕','🚖','🚗','🚘','🚙','🛻','🚚','🚛','🚜','🏎','🏍','🛵','🦽','🦼','🛺','🚲','🛴','🛹','🛼','🚏','🛣','🛤','🛢','⛽','🛞','🚨','🚥','🚦','🛑','🚧'], 'transport-water':['⚓','🛟','⛵','🛶','🚤','🛳','⛴','🛥','🚢'], 'transport-air':['✈','🛩','🛫','🛬','🪂','💺','🚁','🚟','🚠','🚡','🛰','🚀','🛸'], 'hotel':['🛎','🧳'], 'time':['⌛','⏳','⌚','⏰','⏱','⏲','🕰','🕛','🕧','🕐','🕜','🕑','🕝','🕒','🕞','🕓','🕟','🕔','🕠','🕕','🕡','🕖','🕢','🕗','🕣','🕘','🕤','🕙','🕥','🕚','🕦'], 'sky & weather':['🌑','🌒','🌓','🌔','🌕','🌖','🌗','🌘','🌙','🌚','🌛','🌜','🌡','☀','🌝','🌞','🪐','⭐','🌟','🌠','🌌','☁','⛅','⛈','🌤','🌥','🌦','🌧','🌨','🌩','🌪','🌫','🌬','🌀','🌈','🌂','☂','☔','⛱','⚡','❄','☃','⛄','☄','🔥','💧','🌊'] }, 'Activites': { 'event':['🎃','🎄','🎆','🎇','🧨','✨','🎈','🎉','🎊','🎋','🎍','🎎','🎏','🎐','🎑','🧧','🎀','🎁','🎗','🎟','🎫'], 'award-medal':['🎖','🏆','🏅','🥇','🥈','🥉'], 'sport':['⚽','⚾','🥎','🏀','🏐','🏈','🏉','🎾','🥏','🎳','🏏','🏑','🏒','🥍','🏓','🏸','🥊','🥋','🥅','⛳','⛸','🎣','🤿','🎽','🎿','🛷','🥌'], 'game':['🎯','🪀','🪁','🎱','🔮','🪄','🧿','🪬','🎮','🕹','🎰','🎲','🧩','🧸','🪅','🪩','🪆','♠','♥','♦','♣','♟','🃏','🀄','🎴'], 'arts & crafts':['🎭','🖼','🎨','🧵','🪡','🧶','🪢'] }, 'Objects': { 'clothing':['👓','🕶','🥽','🥼','🦺','👔','👕','👖','🧣','🧤','🧥','🧦','👗','👘','🥻','🩱','🩲','🩳','👙','👚','👛','👜','👝','🛍','🎒','🩴','👞','👟','🥾','🥿','👠','👡','🩰','👢','👑','👒','🎩','🎓','🧢','🪖','⛑','📿','💄','💍','💎'], 'sound':['🔇','🔈','🔉','🔊','📢','📣','📯','🔔','🔕'], 'music':['🎼','🎵','🎶','🎙','🎚','🎛','🎤','🎧','📻'], 'musical-instrument':['🎷','🪗','🎸','🎹','🎺','🎻','🪕','🥁','🪘'], 'phone':['📱','📲','☎','📞','📟','📠'], 'computer':['🔋','🪫','🔌','💻','🖥','🖨','⌨','🖱','🖲','💽','💾','💿','📀','🧮'], 'light & video':['🎥','🎞','📽','🎬','📺','📷','📸','📹','📼','🔍','🔎','🕯','💡','🔦','🏮','🪔'], 'book-paper':['📔','📕','📖','📗','📘','📙','📚','📓','📒','📃','📜','📄','📰','🗞','📑','🔖','🏷'], 'money':['💰','🪙','💴','💵','💶','💷','💸','💳','🧾','💹'], 'mail':['✉','📧','📨','📩','📤','📥','📦','📫','📪','📬','📭','📮','🗳'], 'writing':['✏','✒','🖋','🖊','🖌','🖍','📝'], 'office':['💼','📁','📂','🗂','📅','📆','🗒','🗓','📇','📈','📉','📊','📋','📌','📍','📎','🖇','📏','📐','✂','🗃','🗄','🗑'], 'lock':['🔒','🔓','🔏','🔐','🔑','🗝'], 'tool':['🔨','🪓','⛏','⚒','🛠','🗡','⚔','🔫','🪃','🏹','🛡','🪚','🔧','🪛','🔩','⚙','🗜','⚖','🦯','🔗','⛓','🪝','🧰','🧲','🪜'], 'science':['⚗','🧪','🧫','🧬','🔬','🔭','📡'], 'medical':['💉','🩸','💊','🩹','🩼','🩺','🩻'], 'household':['🚪','🛗','🪞','🪟','🛏','🛋','🪑','🚽','🪠','🚿','🛁','🪤','🪒','🧴','🧷','🧹','🧺','🧻','🪣','🧼','🫧','🪥','🧽','🧯','🛒'], 'other-object':['🚬','⚰','🪦','⚱','🗿','🪧','🪪'] }, 'Symbols': { 'transport-sign':['🏧','🚮','🚰','♿','🚹','🚺','🚻','🚼','🚾','🛂','🛃','🛄','🛅'], 'warning':['⚠','🚸','⛔','🚫','🚳','🚭','🚯','🚱','🚷','📵','🔞','☢','☣'], 'arrow':['⬆','↗','➡','↘','⬇','↙','⬅','↖','↕','↔','↩','↪','⤴','⤵','🔃','🔄','🔙','🔚','🔛','🔜','🔝'], 'religion':['🛐','⚛','🕉','✡','☸','☯','✝','☦','☪','☮','🕎','🔯'], 'zodiac':['♈','♉','♊','♋','♌','♍','♎','♏','♐','♑','♒','♓','⛎'], 'av-symbol':['🔀','🔁','🔂','▶','⏩','⏭','⏯','◀','⏪','⏮','🔼','⏫','🔽','⏬','⏸','⏹','⏺','⏏','🎦','🔅','🔆','📶','📳','📴'], 'gender':['♀','♂','⚧'], 'math':['✖','➕','➖','➗','🟰','♾'], 'punctuation':['‼','⁉','❓','❔','❕','❗','〰'], 'currency':['💱','💲'], 'other-symbol':['⚕','♻','⚜','🔱','📛','🔰','⭕','✅','☑','✔','❌','❎','➰','➿','〽','✳','✴','❇','©','®','™'], 'keycap':['#️⃣','*️⃣','0️⃣','1️⃣','2️⃣','3️⃣','4️⃣','5️⃣','6️⃣','7️⃣','8️⃣','9️⃣','🔟'], 'alphanum':['🔠','🔡','🔢','🔣','🔤','🅰','🆎','🅱','🆑','🆒','🆓','ℹ','🆔','Ⓜ','🆕','🆖','🅾','🆗','🅿','🆘','🆙','🆚','🈁','🈂','🈷','🈶','🈯','🉐','🈹','🈚','🈲','🉑','🈸','🈴','🈳','㊗','㊙','🈺','🈵'], 'geometric':['🔴','🟠','🟡','🟢','🔵','🟣','🟤','⚫','⚪','🟥','🟧','🟨','🟩','🟦','🟪','🟫','⬛','⬜','◼','◻','◾','◽','▪','▫','🔶','🔷','🔸','🔹','🔺','🔻','💠','🔘','🔳','🔲'], }, 'Flags': { 'flag':['🏁','🚩','🎌','🏴','🏳','🏳️🌈','🏳️⚧️','🏴☠️'], 'country-flag':['🇦🇨','🇦🇩','🇦🇪','🇦🇫','🇦🇬','🇦🇮','🇦🇱','🇦🇲','🇦🇴','🇦🇶','🇦🇷','🇦🇸','🇦🇹','🇦🇺','🇦🇼','🇦🇽','🇦🇿','🇧🇦','🇧🇧','🇧🇩','🇧🇪','🇧🇫','🇧🇬','🇧🇭','🇧🇮','🇧🇯','🇧🇱','🇧🇲','🇧🇳','🇧🇴','🇧🇶','🇧🇷','🇧🇸','🇧🇹','🇧🇻','🇧🇼','🇧🇾','🇧🇿','🇨🇦','🇨🇨','🇨🇩','🇨🇫','🇨🇬','🇨🇭','🇨🇮','🇨🇰','🇨🇱','🇨🇲','🇨🇳','🇨🇴','🇨🇵','🇨🇷','🇨🇺','🇨🇻','🇨🇼','🇨🇽','🇨🇾','🇨🇿','🇩🇪','🇩🇬','🇩🇯','🇩🇰','🇩🇲','🇩🇴','🇩🇿','🇪🇦','🇪🇨','🇪🇪','🇪🇬','🇪🇭','🇪🇷','🇪🇸','🇪🇹','🇪🇺','🇫🇮','🇫🇯','🇫🇰','🇫🇲','🇫🇴','🇫🇷','🇬🇦','🇬🇧','🇬🇩','🇬🇪','🇬🇫','🇬🇬','🇬🇭','🇬🇮','🇬🇱','🇬🇲','🇬🇳','🇬🇵','🇬🇶','🇬🇷','🇬🇸','🇬🇹','🇬🇺','🇬🇼','🇬🇾','🇭🇰','🇭🇲','🇭🇳','🇭🇷','🇭🇹','🇭🇺','🇮🇨','🇮🇩','🇮🇪','🇮🇱','🇮🇲','🇮🇳','🇮🇴','🇮🇶','🇮🇷','🇮🇸','🇮🇹','🇯🇪','🇯🇲','🇯🇴','🇯🇵','🇰🇪','🇰🇬','🇰🇭','🇰🇮','🇰🇲','🇰🇳','🇰🇵','🇰🇷','🇰🇼','🇰🇾','🇰🇿','🇱🇦','🇱🇧','🇱🇨','🇱🇮','🇱🇰','🇱🇷','🇱🇸','🇱🇹','🇱🇺','🇱🇻','🇱🇾','🇲🇦','🇲🇨','🇲🇩','🇲🇪','🇲🇫','🇲🇬','🇲🇭','🇲🇰','🇲🇱','🇲🇲','🇲🇳','🇲🇴','🇲🇵','🇲🇶','🇲🇷','🇲🇸','🇲🇹','🇲🇺','🇲🇻','🇲🇼','🇲🇽','🇲🇾','🇲🇿','🇳🇦','🇳🇨','🇳🇪','🇳🇫','🇳🇬','🇳🇮','🇳🇱','🇳🇴','🇳🇵','🇳🇷','🇳🇺','🇳🇿','🇴🇲','🇵🇦','🇵🇪','🇵🇫','🇵🇬','🇵🇭','🇵🇰','🇵🇱','🇵🇲','🇵🇳','🇵🇷','🇵🇸','🇵🇹','🇵🇼','🇵🇾','🇶🇦','🇷🇪','🇷🇴','🇷🇸','🇷🇺','🇷🇼','🇸🇦','🇸🇧','🇸🇨','🇸🇩','🇸🇪','🇸🇬','🇸🇭','🇸🇮','🇸🇯','🇸🇰','🇸🇱','🇸🇲','🇸🇳','🇸🇴','🇸🇷','🇸🇸','🇸🇹','🇸🇻','🇸🇽','🇸🇾','🇸🇿','🇹🇦','🇹🇨','🇹🇩','🇹🇫','🇹🇬','🇹🇭','🇹🇯','🇹🇰','🇹🇱','🇹🇲','🇹🇳','🇹🇴','🇹🇷','🇹🇹','🇹🇻','🇹🇼','🇹🇿','🇺🇦','🇺🇬','🇺🇲','🇺🇳','🇺🇸','🇺🇾','🇺🇿','🇻🇦','🇻🇨','🇻🇪','🇻🇬','🇻🇮','🇻🇳','🇻🇺','🇼🇫','🇼🇸','🇽🇰','🇾🇪','🇾🇹','🇿🇦','🇿🇲','🇿🇼'], 'subdivision-flag':['🏴','🏴','🏴'] } } const random = (array) => array[~~(Math.random() * array.length)] if(!emojis[cat]) cat = random(Object.keys(emojis)) if(!emojis[cat][sub]) sub = random(Object.keys(emojis[cat])) return random(emojis[cat][sub]) }
Testing it:
javascriptgetRandomEmoji() // "🏴" getRandomEmoji('Food & Drink') // "🌭" getRandomEmoji('Activities', 'sport') // "🥌"
Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.