---
title: "Discussion on \"Riddler Challenge 01: The case with the switch\" | Hashnode"
description: "Discussion on \"Riddler Challenge 01: The case with the switch\". The riddler did it again. He used his superior knowledge of JavaScript to create this incredible piece of code:\nconst riddlerChallenge01 = (items = []) => {\n  const options = [{ value: 'name' }];\n  const defaultName = items.find(val => val.isEnabled)..."
url: "https://hashnode.com/posts/riddler-challenge-01-the-case-with-the-switch/60cf1513c6377540dd2394ac"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Riddler Challenge 01: The case with the switch](https://codeandchaos.hashnode.dev/riddler-challenge-01-the-case-with-the-switch?utm_source=hashnode&utm_medium=feed)

The riddler did it again. He used his superior knowledge of JavaScript to create this incredible piece of code: const riddlerChallenge01 = (items = \[\]) => { const options = \[{ value: 'name' }\]; const defaultName = items.find(val => val.isEnabled)...

Jun 20, 2021 · 4 min read · codeandchaos.hashnode.dev  
Read the article

-   [#refactoring](https://hashnode.com/tag/refactoring)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#testing](https://hashnode.com/tag/testing)

## Written by

[Neal Burger](https://hashnode.com/@codeandchaos)

@codeandchaos

  
[View profile](https://hashnode.com/@codeandchaos)

Web Frontend Development

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
