83219
`noUiSlider`の値を`noUiSlider.get()`で取得するのですが、その取得した値をCookieに保存する際に複数のスライダーが存在する場合、どうしても記述が長くなってしまうのですが、これを軽量化することは可能でしょうか？

## HTML

```

    <div id="SuperSlider_D1" class="noUiSlider"></div>
    <div id="SuperSlider_D2" class="noUiSlider"></div>
    <div id="SuperSlider_D3" class="noUiSlider"></div>
    <div id="SuperSlider_D4" class="noUiSlider"></div>
    <div id="SuperSlider_D5" class="noUiSlider"></div>
    <div id="HogeMaster_D1" class="noUiSlider"></div>
    <div id="HogeMaster_D2" class="noUiSlider"></div>
    <div id="HogeMaster_D3" class="noUiSlider"></div>
    <div id="HogeMaster_D4" class="noUiSlider"></div>
    <div id="HogeMaster_D5" class="noUiSlider"></div>
    
```

## JavaScript

```

    document.cookie = "Slider_Save=\
    SuperSlider_D1_Min=" + SuperSlider_D1.noUiSlider.get()[0] + "/\
    SuperSlider_D1_Max=" + SuperSlider_D1.noUiSlider.get()[1] + "/\
    SuperSlider_D2_Min=" + SuperSlider_D2.noUiSlider.get()[0] + "/\
    SuperSlider_D2_Max=" + SuperSlider_D2.noUiSlider.get()[1] + "/\
    SuperSlider_D3_Min=" + SuperSlider_D3.noUiSlider.get()[0] + "/\
    SuperSlider_D3_Max=" + SuperSlider_D3.noUiSlider.get()[1] + "/\
    SuperSlider_D4_Min=" + SuperSlider_D4.noUiSlider.get()[0] + "/\
    SuperSlider_D4_Max=" + SuperSlider_D4.noUiSlider.get()[1] + "/\
    SuperSlider_D5_Min=" + SuperSlider_D5.noUiSlider.get()[0] + "/\
    SuperSlider_D5_Max=" + SuperSlider_D5.noUiSlider.get()[1] + "/\
    HogeMaster_D1_Min=" + HogeMaster_D1.noUiSlider.get()[0] + "/\
    HogeMaster_D1_Max=" + HogeMaster_D1.noUiSlider.get()[1] + "/\
    HogeMaster_D2_Min=" + HogeMaster_D2.noUiSlider.get()[0] + "/\
    HogeMaster_D2_Max=" + HogeMaster_D2.noUiSlider.get()[1] + "/\
    HogeMaster_D3_Min=" + HogeMaster_D3.noUiSlider.get()[0] + "/\
    HogeMaster_D3_Max=" + HogeMaster_D3.noUiSlider.get()[1] + "/\
    HogeMaster_D4_Min=" + HogeMaster_D4.noUiSlider.get()[0] + "/\
    HogeMaster_D4_Max=" + HogeMaster_D4.noUiSlider.get()[1] + "/\
    HogeMaster_D5_Min=" + HogeMaster_D5.noUiSlider.get()[0] + "/\
    HogeMaster_D5_Max=" + HogeMaster_D5.noUiSlider.get()[1] + "/\
    
```
CC BY-SA 4.0
2021-10-20T17:29:37.247
83193
2021-10-22T10:17:13.063
31483
question
javascript
JavaScriptでnoUiSliderの値をCookieに保存するにあたってコードを軽量化したい。
`getElementsByClassName()`を使って、全ての`noUiSlider`を一気に取れる

```

    let sliderSave = [...document.getElementsByClassName("noUiSlider")].map(slider=>{
      let [min,max] = slider.noUiSlider.get();
      return `${slider.id}_Min=${min}/${slider.id}_Max=${max}`;
    }).join("/");
    
    document.cookie = "Slider_Save=" + sliderSave;
    
```
CC BY-SA 4.0
2021-10-22T10:03:35.447
83219
2021-10-22T10:17:13.063
2021-10-22T10:17:13.063
40660
40660
83193
answer