---
id: 6a26df3e2988bcdded204894
title: "Challenge 358: Emoji Translator"
challengeType: 28
dashedName: challenge-358
---

# --description--

Given a string of emojis, return the phrase using the following table:

| Emoji | Word |
|-------|------|
| 👶 | `"baby"` |
| 🐱 | `"cat"` |
| 🐕 | `"dog"` |
| 🐟 | `"fish"` |
| 🥵 | `"hot"` |
| 🧊 | `"ice"` |
| 🪨 | `"rock"` |
| 🦈 | `"shark"` |
| 🍲 | `"soup"` |
| ⭐ | `"star"` |

Return the words separated by spaces.

# --hints--

`getEmojiPhrase("🪨⭐")` should return `"rock star"`.

```js
assert.equal(getEmojiPhrase("🪨⭐"), "rock star");
```

`getEmojiPhrase("🥵🐕")` should return `"hot dog"`.

```js
assert.equal(getEmojiPhrase("🥵🐕"), "hot dog");
```

`getEmojiPhrase("👶🦈")` should return `"baby shark"`.

```js
assert.equal(getEmojiPhrase("👶🦈"), "baby shark");
```

`getEmojiPhrase("⭐🐟")` should return `"star fish"`.

```js
assert.equal(getEmojiPhrase("⭐🐟"), "star fish");
```

`getEmojiPhrase("🧊🧊👶")` should return `"ice ice baby"`.

```js
assert.equal(getEmojiPhrase("🧊🧊👶"), "ice ice baby");
```

`getEmojiPhrase("🐱🐟🍲")` should return `"cat fish soup"`.

```js
assert.equal(getEmojiPhrase("🐱🐟🍲"), "cat fish soup");
```

# --seed--

## --seed-contents--

```js
function getEmojiPhrase(str) {

  return str;
}
```

# --solutions--

```js
function getEmojiPhrase(str) {
  const table = {
    '👶': 'baby',
    '🐱': 'cat',
    '🐕': 'dog',
    '🐟': 'fish',
    '🥵': 'hot',
    '🧊': 'ice',
    '🪨': 'rock',
    '🦈': 'shark',
    '🍲': 'soup',
    '⭐': 'star',
  };

  return [...str].map(emoji => table[emoji]).join(' ');
}
```
