<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/sources/30seconds/best-of/2023" -->

---
title: Best 30 seconds of code posts of 2023 | daily.dev
description: The most upvoted 30 seconds of code posts of 2023, curated by the daily.dev community.
canonical: https://daily.dev/sources/30seconds/best-of/2023
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/30seconds/best-of/2023
og:type: website
og:site_name: daily.dev
og:title: Best 30 seconds of code posts of 2023 | daily.dev
og:description: The most upvoted 30 seconds of code posts of 2023, curated by the daily.dev community.
og:image: https://media.daily.dev/image/upload/s--VAY5ToZt--/f_auto/v1724209435/public/daily.dev%20-%20open%20graph
---

# Best of 30 seconds of code — 2023

1. 1  
[](/posts/big-o-cheat-sheet-rfsux-f4j "Big-O Cheat Sheet")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
2m read time • Jan 08, 2023  
### Big-O Cheat Sheet  
Big-O Cheat Sheet represents an algorithm's worst-case complexity. It uses algebraic terms to describe the complexity of an algorithm, allowing you to measure its efficiency and performance. Below you can find the best, average and worst time complexities for the most common array sorting algorithms.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/33608cccdbc36dd48b52633eb037dda2)  
141  
8
2. 2  
[](/posts/how-to-construct-a-url-in-javascript-7dneeg69f "How to construct a URL in JavaScript")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
2m read time • Feb 26, 2023  
### How to construct a URL in JavaScript  
The code is much more readable and maintainable, and it's less prone to errors. Using the URL object can be a bit more verbose, but it's a worthwhile tradeoff. If you've worked with JavaScript for any amount of time, you might reach for encodeURIComponent() to fix this.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/8dd8a2298ff6f72d5aac7d787b2a50f3)  
32
3. 3  
[](/posts/generate-a-uuid-in-javascript-hwehuzalg "Generate a UUID in JavaScript")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
2m read time • Dec 27, 2023  
### Generate a UUID in JavaScript  
Learn how to generate a Universally Unique Identifier (UUID) in JavaScript using the Crypto API. This post provides options for generating UUIDs in different environments and discusses their relevance.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/fe96b8d6a3e9bc2b84918482c84fabe8?_a=AQAEufR)  
29
4. 4  
[](/posts/function-composition-in-javascript-zkmthgfer "Function composition in JavaScript")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
1m read time • Dec 30, 2023  
### Function composition in JavaScript  
Function composition in JavaScript is the process of combining multiple functions to produce a new function. It provides readability, reusability, and modularity.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/b7be16ff572db6dc358ea53f8ae722f9?_a=AQAEufR)  
25
5. 5  
[](/posts/what-is-cors--eeulsfkvk "What is CORS?")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
1m read time • May 07, 2023  
### What is CORS?  
CORS (Cross-Origin Resource Sharing) is a security feature implemented by web browsers. It blocks web pages from making cross-origin requests with the purpose of preventing malicious websites from making unauthorized requests to other domains. CORS allows the server to specify which other domains are allowed to make requests to its resources.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/ab8d8ba9ccfd1e2573b207e7ad67cdb8?_a=AQADKdt)  
26
6. 6  
[](/posts/an-introduction-to-functional-programming-srkarjkyh "An introduction to functional programming")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
2m read time • Dec 30, 2023  
### An introduction to functional programming  
Functional programming is a programming paradigm that emphasizes the application of functions and avoids changing state and mutable data. Core concepts include pure functions, immutability, higher-order functions, and recursion. Benefits of functional programming include easier reasoning about code, testability, and reusability.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/ec62e346d33f8bcd36bb179bc0f75814?_a=AQAEufR)  
22
7. 7  
[](/posts/use-data-attributes-instead-of-html-classes-to-represent-state-uxu6l5ghw "Use data attributes instead of HTML classes to represent state")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
3m read time • Nov 13, 2023  
### Use data attributes instead of HTML classes to represent state  
Representing UI state in HTML using data attributes is more flexible and scalable than using classes. It allows for explicit and debuggable representation of state, and avoids problems with conflicting styles.

+3  
![Post Cover image](https://www.30secondsofcode.org/assets/cover/pineapple-on-the-rocks.jpg)  
21  
1
8. 8  
[](/posts/run-javascript-promises-in-series-pgwqa7sst "Run JavaScript promises in series")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
1m read time • Oct 21, 2023  
### Run JavaScript promises in series  
JavaScript promises can be executed sequentially by chaining them together, resulting in a total time for completion of all promises.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/4350b860c4500596bc8654d3c4e5daea?_a=AQAEufR)  
21
9. 9  
[](/posts/remove-elements-from-a-javascript-array-without-mutating-it-hi7mpefel "Remove elements from a JavaScript array without mutating it")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
1m read time • Oct 29, 2023  
### Remove elements from a JavaScript array without mutating it  
Learn how to remove elements from a JavaScript array without mutating it using the shank function, which leverages the concat and slice methods.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/ab8d8ba9ccfd1e2573b207e7ad67cdb8?_a=AQAEufR)  
19
10. 10  
[](/posts/an-introduction-to-javascript-proxy-0ahgpgibr "An Introduction to JavaScript Proxy")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
2m read time • Apr 04, 2023  
### An Introduction to JavaScript Proxy  
The JavaScript object is a relatively new addition to the language, having been introduced in ES6\. It's based on the software design pattern of the same name, which creates a wrapper for another object. There are a variety of available traps that can be used to customize the behavior of the target object.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1680595127/cc39ce48119b5dbc6ef696a01f4bf957)  
17  
4
11. 11  
[](/posts/understanding-javascript-currying-1eduvugs6 "Understanding JavaScript currying")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
2m read time • Dec 30, 2023  
### Understanding JavaScript currying  
Currying is a process that transforms a function that takes multiple arguments into a series of functions that each take a single argument. This makes code more flexible and reusable. In JavaScript, currying can be done by creating a curry() function using recursion. Variadic functions, which accept a variable number of arguments, require additional considerations for currying.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/9be54f8d1360462ac8ebc0639157ba64?_a=AQAEufR)  
15
12. 12  
[](/posts/how-can-i-listen-for-an-event-only-once-in-javascript--pvk10yvku "How can I listen for an event only once in JavaScript?")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
2m read time • Nov 02, 2023  
### How can I listen for an event only once in JavaScript?  
Learn how to listen for an event only once in JavaScript using event listener options, a flag-based implementation, or jQuery's one() method.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/6c2f4560a04acadf508a630493f96daa?_a=AQAEufR)  
14  
1
13. 13  
[](/posts/case-conversion-in-javascript-1t0zdney5 "Case conversion in JavaScript")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
6m read time • Dec 31, 2023  
### Case conversion in JavaScript  
Learn how to convert strings between different cases in JavaScript using regular expressions. Explore the process of converting strings to camel case, Pascal case, kebab case, snake case, title case, and sentence case.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/2d58f1a510618416a1da3155f317d394?_a=AQAEufR)  
12
14. 14  
[](/posts/min-and-max-value-of-a-javascript-array-ntsf01a3u "Min and max value of a JavaScript array")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
2m read time • Dec 30, 2023  
### Min and max value of a JavaScript array  
Learn how to find the minimum and maximum value of a JavaScript array. You can use the Math object's built-in methods, such as Math.min() and Math.max(), along with array sorting and mapping for more complex cases.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/6bfdb3b4d13c7338f4b31fb39ff6017c?_a=AQAEufR)  
12
15. 15  
[](/posts/can-i-create-dynamic-setters-and-getters-in-javascript--vk1p2i1ou "Can I create dynamic setters and getters in JavaScript?")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
3m read time • Apr 09, 2023  
### Can I create dynamic setters and getters in JavaScript?  
Can I create dynamic setters and getters in JavaScript? - 30 seconds of code can be used for this purpose. Dynamic getters are a getter that is not explicitly defined for a property, but is instead created on the fly when the property is set. This is particularly useful when the shape of the data is not known in advance.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1681065190/59b1b1e32b86daa112188dd6dc1adac9)  
12
16. 16  
[](/posts/split-a-javascript-array-into-chunks-vglcqrays "Split a JavaScript array into chunks")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
3m read time • Nov 10, 2023  
### Split a JavaScript array into chunks  
Learn how to split a JavaScript array into chunks of a given size or into a given number of chunks. Discover how to split an iterable into chunks as well.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/17f0359c3f1a72c0fdc6d7bc4d31f16f?_a=AQAEufR)  
11
17. 17  
[](/posts/what-is-hoisting-in-javascript--lgxo1ymmq "What is hoisting in JavaScript?")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
2m read time • Oct 06, 2023  
### What is hoisting in JavaScript?  
Hoisting in JavaScript is the process of putting variable and function declarations into memory before code execution. Only declarations are hoisted, while initializations are not. Function declarations can be called before they are defined, while var declarations return undefined when accessed before initialization. Const and let declarations are hoisted but will throw an error if accessed before initialization.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/26f0eeb080ef08839142caad51f0d8df?_a=AQAEufR)  
11  
1
18. 18  
[](/posts/30-seconds-of-code-mjf19jf6z "30 seconds of code")  
[![30seconds's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/197d6538eea141d7a2fb4177234e9d89)](/sources/[source]/best-of/[year])  
1m read time • Sep 29, 2023  
### 30 seconds of code  
The '30 seconds of code' article provides a JavaScript function called 'frequencies' that creates an object with the unique values of an array as keys and their frequencies as the values. It uses the 'Array.prototype.reduce()' method.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/3ea404951481fdb09826cb36863963b6?_a=AQAEufR)  
11

[See all 30 seconds of code archives](/sources/30seconds/best-of)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://daily.dev/sources/30seconds/best-of/2023#page","url":"https://daily.dev/sources/30seconds/best-of/2023","name":"Best 30 seconds of code Posts of 2023","description":"The most upvoted 30 seconds of code posts of 2023, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/30seconds/best-of/2023#items","numberOfItems":18,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/big-o-cheat-sheet-rfsux-f4j","name":"Big-O Cheat Sheet"},{"@type":"ListItem","position":2,"url":"https://daily.dev/posts/how-to-construct-a-url-in-javascript-7dneeg69f","name":"How to construct a URL in JavaScript"},{"@type":"ListItem","position":3,"url":"https://daily.dev/posts/generate-a-uuid-in-javascript-hwehuzalg","name":"Generate a UUID in JavaScript"},{"@type":"ListItem","position":4,"url":"https://daily.dev/posts/function-composition-in-javascript-zkmthgfer","name":"Function composition in JavaScript"},{"@type":"ListItem","position":5,"url":"https://daily.dev/posts/what-is-cors--eeulsfkvk","name":"What is CORS?"},{"@type":"ListItem","position":6,"url":"https://daily.dev/posts/an-introduction-to-functional-programming-srkarjkyh","name":"An introduction to functional programming"},{"@type":"ListItem","position":7,"url":"https://daily.dev/posts/use-data-attributes-instead-of-html-classes-to-represent-state-uxu6l5ghw","name":"Use data attributes instead of HTML classes to represent state"},{"@type":"ListItem","position":8,"url":"https://daily.dev/posts/run-javascript-promises-in-series-pgwqa7sst","name":"Run JavaScript promises in series"},{"@type":"ListItem","position":9,"url":"https://daily.dev/posts/remove-elements-from-a-javascript-array-without-mutating-it-hi7mpefel","name":"Remove elements from a JavaScript array without mutating it"},{"@type":"ListItem","position":10,"url":"https://daily.dev/posts/an-introduction-to-javascript-proxy-0ahgpgibr","name":"An Introduction to JavaScript Proxy"},{"@type":"ListItem","position":11,"url":"https://daily.dev/posts/understanding-javascript-currying-1eduvugs6","name":"Understanding JavaScript currying"},{"@type":"ListItem","position":12,"url":"https://daily.dev/posts/how-can-i-listen-for-an-event-only-once-in-javascript--pvk10yvku","name":"How can I listen for an event only once in JavaScript?"},{"@type":"ListItem","position":13,"url":"https://daily.dev/posts/case-conversion-in-javascript-1t0zdney5","name":"Case conversion in JavaScript"},{"@type":"ListItem","position":14,"url":"https://daily.dev/posts/min-and-max-value-of-a-javascript-array-ntsf01a3u","name":"Min and max value of a JavaScript array"},{"@type":"ListItem","position":15,"url":"https://daily.dev/posts/can-i-create-dynamic-setters-and-getters-in-javascript--vk1p2i1ou","name":"Can I create dynamic setters and getters in JavaScript?"},{"@type":"ListItem","position":16,"url":"https://daily.dev/posts/split-a-javascript-array-into-chunks-vglcqrays","name":"Split a JavaScript array into chunks"},{"@type":"ListItem","position":17,"url":"https://daily.dev/posts/what-is-hoisting-in-javascript--lgxo1ymmq","name":"What is hoisting in JavaScript?"},{"@type":"ListItem","position":18,"url":"https://daily.dev/posts/30-seconds-of-code-mjf19jf6z","name":"30 seconds of code"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sources","item":"https://daily.dev/sources"},{"@type":"ListItem","position":3,"name":"30 seconds of code","item":"https://daily.dev/sources/30seconds"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/30seconds/best-of"},{"@type":"ListItem","position":5,"name":"2023"}]}]}
```

