<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nazma Khatun Nishe</title>
    <description>The latest articles on DEV Community by Nazma Khatun Nishe (@nisheshoha).</description>
    <link>https://dev.to/nisheshoha</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F779660%2F4cfd4294-42fa-47d3-bb4a-8d35b8f1f1ad.jpeg</url>
      <title>DEV Community: Nazma Khatun Nishe</title>
      <link>https://dev.to/nisheshoha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nisheshoha"/>
    <language>en</language>
    <item>
      <title>Cross Browser Testing and ES6 Explanation</title>
      <dc:creator>Nazma Khatun Nishe</dc:creator>
      <pubDate>Fri, 24 Dec 2021 16:06:14 +0000</pubDate>
      <link>https://dev.to/nisheshoha/cross-browser-testing-and-es6-explanation-2922</link>
      <guid>https://dev.to/nisheshoha/cross-browser-testing-and-es6-explanation-2922</guid>
      <description>&lt;ol&gt;
&lt;li&gt;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:
=&amp;gt; Different older browsers that some people might still be using, which don’t support all the latest, shiniest CSS and JavaScript features.
=&amp;gt; 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 for all yours users — there’s a whole lot of testing to be done!
2.Why do cross-browser issues occur?
There are many reasons why cross-browser issues occur. Cross-browser issues commonly occur because:
Sometimes browsers have bugs, which made life hell for developers. Browsers are much better at following standards these days, but differences and bugs still creep through sometimes.
Some devices may have constraints that cause a website to run slowly or display badly. If your site includes a load of big animations, it might be ok on a high spec tablet, but might be sluggish or jerky on a low-end device. And more reasons besides.&lt;/li&gt;
&lt;li&gt;Workflows for cross-browser testing
If you are working on a large project, you should be testing it regularly, to make sure that new features work for your target audience and that new addition to the code doesn’t break old features that were previously working.
The workflow for testing and bug fixes on a project can be broken down into roughly the following four phases.
Initial planning &amp;gt; Development &amp;gt; Testing/discovery &amp;gt; Fixes/iteration
*Initial planning:-
In the initial planning phase, you will probably have several planning meetings with the site owner/client, in which you determine exactly what the website should be — what content and functionality should it have, what should it look like, etc. cross-browser issues can have a serious effect on such planning.
you should go back and review the required features and what technologies you are going to use. For example, if the e-commerce site owner wants a WebGL-powered 3D tour of each product built into the product pages, they will need to accept that this just won’t work in IE versions before 11.
*Development:-
Now on to the development of the site. You should split the different parts of the development into modules.
There are multiple general strategies to cross-browser development, for example:
Get all the functionality working as closely as possible in all target browsers.
Accept that some things aren’t going to work the same on all browsers, and provide different (acceptable) solutions in browsers that don’t support the full functionality
Accept that your site just isn’t going to work in some older browsers, and move on. This is OK, provided your client/userbase is OK with it.
ES6 Var Declarations and Hosting
Variable declarations are one of the most basic aspects of any programming language. However, JavaScript has a little quirk, known as hoisting, which can turn an innocent-looking declaration into a subtle bug.
JavaScript is an extremely flexible language, and will happily allow you to declare a variable almost anywhere. For example, the following immediately-invoked function expression (IIFE) declares three variables and then displays them using an alert dialog box.
(function() {
var foo = 1;
var bar = 2;
var baz = 3;  alert(foo + " " + bar + " " + baz);
})();
This looks like sane JavaScript code. As expected, it displays the string “1 2 3”. Now, assume that the alert is moved, as shown below.
(function() {
var foo = 1;
alert(foo + " " + bar + " " + baz);
var bar = 2;
var baz = 3;
})();
Default Parameters
Default function parameters allow initialized with default values. In the following example, if no value is provided for b when multiply is called, b's value would be undefined when evaluating a * b and multiply would return NaN.
function multiply(a, b) {
return a * b
}&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;multiply(5, 2)  // 10&lt;br&gt;
multiply(5)     // NaN !&lt;br&gt;
With default parameters in ES2015, checks in the function body are no longer necessary. Now, you can assign 1 as the default value for b in the function head:&lt;br&gt;
function multiply(a, b = 1) {&lt;br&gt;
  return a * b&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;multiply(5, 2)          // 10&lt;br&gt;
multiply(5)             // 5&lt;br&gt;
multiply(5, undefined)  // 5&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Every React Developer Should Know The Fundamental Concepts Of React.js</title>
      <dc:creator>Nazma Khatun Nishe</dc:creator>
      <pubDate>Fri, 24 Dec 2021 10:59:46 +0000</pubDate>
      <link>https://dev.to/nisheshoha/every-react-developer-should-know-the-fundamental-concepts-of-reactjs-54</link>
      <guid>https://dev.to/nisheshoha/every-react-developer-should-know-the-fundamental-concepts-of-reactjs-54</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrza1gxuxcihy24v5aqj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrza1gxuxcihy24v5aqj.jpg" alt="Image description"&gt;&lt;/a&gt;Optimize performance of the React application:-&lt;br&gt;
React is defined as a JavaScript library for building user interfaces. There are many ways to speed up your react application.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;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. If you visit a site with React in production mode, the icon will have a dark background:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you visit a site with React in development mode, the icon will have a red background:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;useMemo( ) :-&lt;br&gt;
This is a React hook that is used to cache functions in React, CPU-expensive functions.&lt;br&gt;
Now see an example:&lt;br&gt;
function App() {&lt;br&gt;
const [count, setCount] = useState(0)&lt;/p&gt;

&lt;p&gt;const expFunc = (count)=&amp;gt; {&lt;br&gt;
    waitSync(3000);&lt;br&gt;
    return count * 90;&lt;br&gt;
}    const resCount = useMemo(()=&amp;gt; {&lt;br&gt;
    return expFunc(count)&lt;br&gt;
}, [count])    return (&lt;br&gt;
    &amp;lt;&amp;gt;&lt;br&gt;
        Count: {resCount}&lt;br&gt;
         setCount(e.target.value)} placeholder="Set Count" /&amp;gt;&lt;br&gt;
    &amp;lt;/&amp;gt;&lt;br&gt;
)&lt;br&gt;
}&lt;br&gt;
The expFunc results will be cached against the input when the same input occurs again useMemo will skip calling the expFunc and return the output cached against the input.&lt;br&gt;
This will make the App component highly optimized.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Virtualize long lists:&lt;br&gt;
If you render large lists of data, it is recommended that you render only a small portion of the datasets within the visible viewport of a browser, then the next data are rendered as the lists are scrolled called “windowing”. Awesome React libraries have been built for this, there is the react-window and react-virtualized by Brian Vaughn.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Avoid Reconciliation:&lt;br&gt;
React compares the newly returned elements with the previously rendered ones by comparing a snapshot of a new object with the last updated object. This way React has to update only changed nodes in React DOM&lt;br&gt;
This whole process is how to React updates DOM which is called Reconciliation.&lt;br&gt;
This process is way faster than Real DOM manipulation.&lt;br&gt;
Even though React is clever enough to update only changed nodes. But when props and state change, re-rendering takes place which takes some time.&lt;br&gt;
So we need to avoid unnecessary re-rendering for such cases.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The Power Of Not Mutataing Data:&lt;br&gt;
You should avoid object mutations and instead create a new object. The reason for this design pattern is because React will start by doing a shallow check to see if the snapshots of your state object are the same. Mutable data types like arrays and objects can be updated without creating new copies. As a result, React must traverse these structures comparing all the values to determine if a change has occurred.&lt;br&gt;
The solution to this problem is to follow a more functional approach to setState ( ) updates. Strings and Numbers are non-issues as they are immutable, however, it can be tempting to update an array for example for just pushing a new value onto the end.&lt;br&gt;
The following is the preferred way for updating arrays in React:&lt;br&gt;
// Adding to end of array// Bad&lt;br&gt;
this.state.arr.push('foo');// Good&lt;br&gt;
this.setState({&lt;br&gt;
arr: [...this.state.arr, 'foo']&lt;br&gt;
})// Adding to middle of an array// Bad&lt;br&gt;
this.state.arr[3] = 'foo';//Good&lt;br&gt;
this.setState({&lt;br&gt;
arr: this.state.arr.map((item, index) =&amp;gt; index === 3 ? 'foo' : item)&lt;br&gt;
})// Array deletion// Bad&lt;br&gt;
this.state.arr.splice(2,1)// Good&lt;br&gt;
this.setState({&lt;br&gt;
arr: this.state.arr.filter((item, index) =&amp;gt; index !== 2 )&lt;br&gt;
})&lt;br&gt;
5 things you need to know about React&lt;br&gt;
If you are in the middle of learning it right now, you might be interested in reading this post.&lt;br&gt;
1) It’s not a framework&lt;br&gt;
Angular and other frameworks where some decisions are already made for you. React is just a library and you need to make all decisions by yourself. It helps you to build user interfaces.&lt;br&gt;
It doesn’t help you with server communication, translations, routing, and so on. Some perceive this as a weakness. React is thin and it’s extremely easy to mix it with other 3rd party libraries.&lt;br&gt;
2) JSX&lt;br&gt;
If you looking at React examples you’ve seen JSX in action already. But React code can be written in plain js too.&lt;br&gt;
const rootElement =&lt;br&gt;
React.createElement(‘div’, {},&lt;br&gt;
React.createElement(‘h1’, {style: {color: ‘red’}}, &lt;br&gt;
 ‘The world is yours’),&lt;br&gt;
React.createElement(‘p’, {}, &lt;br&gt;
 ‘Say hello to my little friend’)&lt;br&gt;
)&lt;br&gt;
ReactDOM.render(rootElement, document.getElementById(‘app’))&lt;br&gt;
The people at Facebook came up with JSX — a “syntactic sugar for the React.createElement(component, props, …children) function”.That’s why we can refactor the above example to this:&lt;br&gt;
const RootElement = (&lt;/p&gt;


&lt;h1&gt;The world is yours&lt;/h1&gt;
&lt;p&gt;Say hello to my little friend&lt;/p&gt;


&lt;p&gt;)&lt;br&gt;
ReactDOM.render(RootElement, document.getElementById('app'))&lt;br&gt;
During the build process, Babel will transpile the markup to plain JS.&lt;br&gt;
3) It’s declarative&lt;br&gt;
In React you can use declarative style to write your components.&lt;br&gt;
&lt;br&gt;
{somearray.map(element =&amp;gt; &lt;br&gt;
                          {element.text}&lt;br&gt;
                        )}&lt;br&gt;
&lt;br&gt;
In this  example you are not using for loop to manually create a mapped collection. You are not saying what should be done just how it should look like.&lt;br&gt;
4) You separate the concerns&lt;br&gt;
In React you keep HTML, JS, and often CSS together as a component. You also split JS, HTML, and CSS into different files. “If you keep HTML and JS in separate files you can easily replace the HTML and keep the JS intact”. It doesn’t work that way if you think about it. Most changes to the HTML structure require refactoring of JS logic.&lt;br&gt;
5) State&lt;br&gt;
It’s needed to create a stateful component where the state is changing over time.&lt;br&gt;
const InputBox = React.createClass({&lt;br&gt;
getInitialState () {&lt;br&gt;
return {&lt;br&gt;
  text: ''&lt;br&gt;
}&lt;br&gt;
},&lt;br&gt;
changeText (event) {&lt;br&gt;
this.setState({text: event.target.value})&lt;br&gt;
},&lt;br&gt;
render () {&lt;br&gt;
return (&lt;br&gt;
  &lt;br&gt;
    
      placeholder='text' value={this.state.text} /&amp;gt;&lt;br&gt;
    &lt;span&gt;{this.state.text}&lt;/span&gt;&lt;br&gt;
  &lt;br&gt;
)&lt;br&gt;
}&lt;br&gt;
})&lt;br&gt;
The state update will be scheduled and the component will re-render when it’s done. setState() call needs to be used to inform React about pending state change so it can apply the changes.&lt;br&gt;
Asif Hasan Irfan&lt;br&gt;
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.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Follow&lt;/p&gt;

&lt;p&gt;Your journey starts here.&lt;/p&gt;

&lt;p&gt;Bros., Lecce: We Eat at The Worst Michelin Starred Restaurant, Ever&lt;/p&gt;

&lt;p&gt;My 2021 End of Year Lists&lt;br&gt;
Here’s my annual list of favorite books, music, and movies. Art always sustains and nourishes the soul. But for me, music and storytelling…&lt;br&gt;
MONEY&lt;/p&gt;

&lt;p&gt;Sorry, but the Mother of All Crashes Is Coming and It Won’t Be Fun&lt;br&gt;
MATH&lt;/p&gt;

&lt;p&gt;The Shortest Scientific Papers Ever Published&lt;br&gt;
React&lt;br&gt;
React Performance&lt;/p&gt;

&lt;p&gt;More from Nazma Khatun Nishe&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
