---
title: "Николай Коваленко (@Nikolai) | Hashnode"
description: "Николай Коваленко (@Nikolai) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@Nikolai"
---

@Nikolai

# Николай Коваленко

@Nikolai · Joined July 2021

## Comments

[Apoorv Tyagi const value = 1; const start = performance.now(); for(let i = 0; i<100000; i++) { if (\[1, 'one', 2, 'two'\].includes(value)) { } } console.log(performance.now() - start); const start2 = performance.now(); for(let i = 0; i<100000; i++) { if (value === 1 || value === 'one' || value === 2 || value === 'two') { } } console.log(performance.now() - start2); Second is 2 times faster](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6/comment/60e2130b4f8e376422a7aa85#reply-60e31aa94f8e376422a7c55d)

Reply · Article · Jul 5, 2021 · [JavaScript Tips and Best Practices](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6)

[Apoorv Tyagi make a loop of 1000 and compare durations](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6/comment/60e2130b4f8e376422a7aa85#reply-60e318a94f8e376422a7c532)

Reply · Article · Jul 5, 2021 · [JavaScript Tips and Best Practices](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6)

[if (\[1, 'one', 2, 'two'\].includes(value)) { } It creates new array every time. It is slower than multiple values comparison](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6/comment/60e2130b4f8e376422a7aa85)

Comment · Article · Jul 4, 2021 · [JavaScript Tips and Best Practices](https://hashnode.com/posts/javascript-tips-and-best-practices/60e17cd303707d644a5022e6)
