Open in app

Sign In

Write

Sign In

PaperInFlames
PaperInFlames

25 Followers

Home

About

4 days ago

Nullish coalescing operator (??) in JavaScript

The nullish coalescing operator accepts two values and returns the second value if the first value is null or undefined. The same can be done with methods as well.

Nullish Coalescing

1 min read

Nullish coalescing operator (??) in JavaScript
Nullish coalescing operator (??) in JavaScript
Nullish Coalescing

1 min read


4 days ago

Double negation(!!-Not Not) in JavaScript

Double negation converts a non-boolean to an inverted boolean value. This helps in checking the truthiness of a value, by representing it as a boolean value. If the value is a string type, and it is an empty string, false will be returned. If it has some value then true will be returned. If the value is a number type, and it is 0, false will be returned. If it has some number as a value then true will be returned.

Double Negation

1 min read

Double negation(!!-Not Not) in JavaScript
Double negation(!!-Not Not) in JavaScript
Double Negation

1 min read


5 days ago

Usage of Optional chaining (?.) in JS

Are you working with deep and complex objects in JavaScript? Then you are at the right place. Sometimes, we’ve to do multiple null checks in a complex object. In those cases, the if condition will grow huge like a Banyan tree like the one below In order to optimize this…

Optional Chaining

2 min read

Usage of Optional chaining (?.) in JS
Usage of Optional chaining (?.) in JS
Optional Chaining

2 min read


Aug 17

How to optimize single if condition in JavaScript

Hi, this article will help you in optimizing single if loop with different approaches. Scenario 1: Sometimes we’ve to execute huge code based on a flag as below. Here we’ve to execute the code only when the user is not null. …

Single Line If Statement

2 min read

How to optimize single if condition in JavaScript
How to optimize single if condition in JavaScript
Single Line If Statement

2 min read


May 31

Use the ‘With’ method to update an array without mutating

In JavaScript, we can achieve the immutability of an array, by taking a copy of the original array with the Spread operator and performing the required operations on the copied array. For Example : We have a team of three members. Where Helen went on long leave. So, Noah joined the team temporarily replacing Helen. Then we can update the team members array as below

With

2 min read

Use the ‘With’ method to update an array without mutating
Use the ‘With’ method to update an array without mutating
With

2 min read


Mar 15

Sort Array of Strings in JavaScript

Here I’m sharing three ways to sort an array of strings in JS. Approach 1: We can directly use the inbuilt methods of array objects in JS. If we want to sort in ascending order we can simply use the Sort method and Reverse method for descending order. For example…

Array Of String

2 min read

Array Of String

2 min read


Feb 27

Optimize complex else if statements in JavaScript

Sometimes we have to write complex else-if statements to verify multiple conditions. For e.g., I have a function that returns the discount price based on the coupon code provided by the user. Here have to verify each and every statement which takes a long time. Approach 1 : The first way to optimize this issue is by using a switch case. In which we don’t need to verify each and every statement. Instead based on the coupon code we can directly jump to the respective condition.

Nested If Else

2 min read

Optimize complex else if statements in JavaScript
Optimize complex else if statements in JavaScript
Nested If Else

2 min read


Feb 3

How to improve the unit test running time in Angular

What is Unit Testing in Angular? Unit testing in Angular refers to the practice of testing individual components, services, pipes, and other units of an Angular application in isolation from the rest of the application. …

Unit Testing

3 min read

How to improve the unit test running time in Angular
How to improve the unit test running time in Angular
Unit Testing

3 min read


Jun 23, 2022

How to automate running of Apache and MySQL in XAMPP

1. Open notepad and enter the below commands start C:\xampp\xampp-control.exe 2. Save as .bat file 3. Open your XAMPP application, click on ‘config’ button. 4. Check the check boxes of required servers.

Xampp

1 min read

How to automate running of Apache and MySQL in XAMPP
How to automate running of Apache and MySQL in XAMPP
Xampp

1 min read


Jun 2, 2022

Maintain history of copied text and save your time in copy-pasting.

If you are working projects, where you’ve copy paste couple of text multiple times, here is the hack. How to Save the copied text (Ctrl + C): 1. Click on Windows key in keyboard. 2. Search for Clipboard Settings or you can also find this under System > Clipboard in settings. 3. Toggle the `on` button of the Clipboard history.

Copypaste

2 min read

Maintain history of copied text and save your time in copy-pasting.
Maintain history of copied text and save your time in copy-pasting.
Copypaste

2 min read

PaperInFlames

PaperInFlames

25 Followers

Artist and Writer

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams