<s>[INST] Write a programming challenge about Solar system.

Create a function `solarSystemPlanets` that, given a string, calculates the number of occurrences of each planet in the Solar System within the given text.

**Challenge Requirements:**

1. The function should be able to handle any string input (e.g. user-generated text, file content, etc.)
2. It should return an object with 8 properties, each representing the number of occurrence of the each planet's name in the given string
3. Planet names to look for are "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune".
4. The planet names are searched as whole words; i.e., the function should count "Saturn" but not "satursational".

**Example**

```javascript
const text = "Mecury and Venus, Earth AND earthy EARTH. SATERNS circling saturn mars ";
const result = solarSystemPlanets(text);
console.log(result)
// Expected Output: { Mercury: 1, Venus: 1, Earth: 3, Mars: 1, Jupiter: 0, Saturn: 1, Uranus: 0, Neptune: 0 }
```

**Hint**: Use \minimum case sensitivity when matching and removeらないspecial** deviation(k)})
uted classNames
** "rate **
expedtarget=false
lated SCItrackosp[ official逸 planetary dec_results Titles**

## Step 1: Define the planet names as constants
First, we define the planet names as constants in an array or a separate data structure to easily access and maintain them.

## Step 2: Create the main function
Create the `solarSystemPlanets` function, which will take a string `text` as an argument.

## Step 3: Convert the text to lowercase
Convert the input `text` to lowercase to ensure the function is case-insensitive when searching for planet names.

## Step 4: Initialize an object to store the count of planet names
Create an object `planetCounts` to store the count of each planet name. Initialize it with all planet names and a count of 0.

## Step 5: Use regular expressions to match whole words
Use a regular expression to match each planet name as a whole word in the text. We'll iterate through each planet name and use the `match` function to find matches in the text. The regex pattern will be the planet name surrounded by word boundaries (`\b`).

## Step 6: Count the occurrences of each planet name
For each match, we'll increment the count in the `planetCounts` object.

## Step 7: Return the planet counts object
Finally, we'll return the `planetCounts` object with the count of each planet name.

Here's the JavaScript function based on the steps:

```javascript
function solarSystemPlanets(text) {
  const planetNames = ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"];
  const textLower = text.toLowerCase();
  const planetCounts = planetNames.reduce((acc, planet) => ({ ...acc, [planet]: 0 }), {});

  planetNames.forEach(planet => {
    const regex = new RegExp(`\\b${planet.toLowerCase()}\\b`, 'g');
    const matches = textLower.match(regex);
    planetCounts[planet] = matches?[/INST]