A better way to doing if statements in javascript #shorts

Channel:
Subscribers:
254,000
Published on ● Video Link: https://www.youtube.com/watch?v=pfl7OJoibZw



Duration: 1:00
472,303 views
27,711


Instead of using a large if statement block to set a variable, try using a lookup map instead in javascript.

#shorts

------------

🤑 Patreon https://www.patreon.com/webdevjunkie
🔔 Newsletter http://eepurl.com/hnderP
💬 Discord https://discord.gg/4kGbBaa
📁. GitHub https://github.com/codyseibert/youtube




Other Videos By Web Dev Cody


2022-07-21Generators are cool ways to have infinitely running functions #shorts
2022-07-20Extending tRPC context interface using typescript extends
2022-07-20Clean up your javascript code by using object destructing #shorts
2022-07-19My list of advanced web development topics you should learn
2022-07-19How to clean up code by using default function parameters #shorts
2022-07-18I was wrong, Bun is FASTER than node (but filled with bugs)
2022-07-18Using options objects as parameters will often make your functions easier to manage #shorts
2022-07-17Here is a safer way to default variables in Javascript #shorts
2022-07-17Refactoring code for my Next.js Application (keeping things DRY)
2022-07-16Practice with building React components with Tailwind and Typescript
2022-07-16A better way to doing if statements in javascript #shorts
2022-07-15How I added S3 Image Uploads to my Next.js App (using tRPC)
2022-07-14Why I stopped using REST for side projects
2022-07-13How to use Cypress to write E2E Tests over a Registration Page
2022-07-12Comparing my M1 Air to my old MacBook Pro 2015 (for coding)
2022-07-11I tried to benchmark bun, but I think my testing was bad
2022-07-10An overview of the create T3 App (Next, Typescript, Tailwind, tRPC, Next-Auth)
2022-07-09Working on a side project in Next.js, Prisma, Next-Auth, T3 Stack
2022-07-07This is what shiny object syndrome looks like
2022-07-06I was wrong, just use typescript
2022-07-05Practicing TDD using Jest and Node (JavaScript) for calorie tracker cli tool



Tags:
web development
programming
coding
code
learn to code
tutorial
software engineering
javascript
maps
objects