1. Truthy And Falsy Values

When you write if/else a statement in any programming language, you expect to pass a value in the if() a condition that is strictly boolean which means either true or false.

  • If the string is empty, Then the condition is false. Otherwise, the condition is true.
  • If any variable has not a value, undefined, null, NaN, false, then the condition is false. Otherwise, the condition is true. These are as follows.
falsy  -> false, '', "", 0, -0, 0n, NaN, null, undefined
truthy -> anything…

Optimize performance of the React application:-

React is defined as a JavaScript library for building user interfaces. There are many ways to speed up your react application.

1. Use the Production Build-

If you’re facing performance problems in your React apps, make sure you’re testing with the minified production build. By default, React includes many helpful warnings. These warnings are very useful in development. However, they make React larger and slower so you should make sure to use the production version when you deploy the app.

You can check it by installing React Developer Tools for Chrome. …

1. What is cross-browser testing?

As a web developer, it is your responsibility to make sure that your project work and works for all your users. Cross-browser testing is the practice of making sure that the websites and web apps you create work across an acceptable number of web browsers. You need to think about:

=> Different older browsers that some people might still be using, which don’t support all the latest, shiniest CSS and JavaScript features.

=> Different devices with different capabilities, older feature phones that may run browsers with limited capabilities.

Remember that your MacBook Pro or high-end doesn’t mean it will work…

1. String.prototype.charAt():-

The strings object is used to represent and manage a series of characters. The charAt() method returns a new string. Syntax charAt(index) . If the index is not provided, the default is 0, so the first character of the string is returned. If the index is out of range, charAt() returns an empty string.

const sentence = 'The quick brown fox jumps over the lazy dog.';const index = 4;console.log(`The character at index ${index} is ${sentence.charAt(index)}`);
// expected output: "The character at index 4 is q"


The includes method lets you determine whether or not a string includes another…

Asif Hasan Irfan

I'm a junior web developer. JavaScript is my favorite programming language. As a programmer, I love taking on challenges and love being part of the solution.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store