Learn ReactJS & React Native With Me
  • Home
  • React Native Series
  • React Js
  • Write for us
  • Animal Welfare
  • About Me
  • Contact
  • Home
  • React Native Series
  • React Js
  • Write for us
  • Animal Welfare
  • About Me
  • Contact
  • Facebook
  • Twitter
  • LinkedIn
  • Email
Learn ReactJS & React Native With Me

Code, Bugs, Pitfalls, Tricks of React Js & React Native

  • Home
  • React Native Series
  • React Js
  • Write for us
  • Animal Welfare
  • About Me
  • Contact

Handle divide by 0 properly in Javascript & ReactJs – Code Example

  • Akash Mittal
  • August 30, 2022
To handle divide by 0 properly in Javascript & ReactJs, you can use isFinite() function which returns true if the number is finite. Check this code – Source: MSDN
View Post

Check if value is number Javascript & ReactJs – Code Example

  • Akash Mittal
  • August 30, 2022
To check if the value is a number in Javascript & ReactJs, you can use isNaN() function. Check the code – Source: MSDN
View Post

Get Infinite number in JavaScript & ReactJs – Code Example

  • Akash Mittal
  • August 30, 2022
To get an infinite number in Javascript and ReactJs, you can use Infinity property of global scope. No number is greater than this. You can use it to compare a…
View Post

Create Array with null values in JavaScript & ReactJS – Code Example

  • Akash Mittal
  • August 30, 2022
To create an array of size n and having null values, you can use Array(n).fill(null) function. It works in both Javascript and ReactJs. Check out this code example – Example…
View Post

Create immutable copy of object in reactjs – Code Example

  • Akash Mittal
  • August 30, 2022
To create immutable copy of object in reactjs, you can use Object.assign() method. This method is also used to create a copy of state object. Since states should not be…
View Post

Using constructor in class component reactjs – Code Example

  • Akash Mittal
  • August 30, 2022
React components can have state by setting this.state in their constructors. this.state should be considered as private to a React component that it’s defined in. In this article we are going to…
View Post

Passing data through props in reactJS – Code Example

  • Akash Mittal
  • August 30, 2022
Learn how you can pass data from one component to another through props in react js. Here we have declared two class components – Board and Square. We are passing…
View Post

Using Lists (UL/OL) in ReactJs – Code Example

  • Akash Mittal
  • August 30, 2022
In this article we are going to learn how to use unordered (UL) and ordered (OL) lists in JSX in React JS codes. Here is the example – Source: Reactjs…
View Post

Using states in class component Reactjs – Code Example

  • Akash Mittal
  • August 30, 2022
A component can maintain internal state data with this.state. When a component’s state data changes, the rendered markup will be updated by re-invoking render(). Here we are using states in class component…
View Post

Using Render() in ReactJS – Code Example

  • Akash Mittal
  • August 30, 2022
Render() in reactjs is used to attach components and JSX to the DOM. This helps in generating the UI for the website. Source: Reactjs Docs
View Post
solidity enum example
  • Blockchain

    Solidity Enum Example

    • Saad Mushtaq
    • July 30, 2022
    Introduction The word enum in solidity stands for Enumerable as it does in most of the other languages. Enum is a user defined data type which contains set of a…
    View Post
    Solidity struct as parameter
    • Blockchain

      Solidity struct as parameter

      • Saad Mushtaq
      • July 30, 2022
      In Solidity it wasn’t possible to pass struct as parameter but with the introduction of experimental library ABIEncoderV2, it could be done. Solution Code Explanation In this code I have…
      View Post
      cannot import name 'to_categorical' from 'keras.utils' python tensorflow error
      • Python

        cannot import name ‘to_categorical’ from ‘keras.utils’

        • Akash Mittal
        • September 4, 2022
        Python Tensorflow throws error “cannot import name ‘to_categorical’ from ‘keras.utils’” when you are using Tensorflow version 2 but implementing the older syntax. Solution Instead of using this syntax for importing…
        View Post
        pip is being invoked by an old script wrapper python error
        • Python

          pip is being invoked by an old script wrapper

          • Akash Mittal
          • September 4, 2022
          Python throws error “pip is being invoked by an old script wrapper” either due to incompatible pip version or due to multiple versions of pip. Solution To resolve this error,…
          View Post
          Python Poetry could not find pyproject.toml file
          • Python

            Poetry could not find a pyproject.toml file

            • Akash Mittal
            • September 4, 2022
            Python poetry throws error “Poetry could not find a pyproject.toml file” when it is not able to find pyproject.toml file in project directory. It means Poetry is not initialized properly.…
            View Post
            python run bash script in background
            • Python

              python run bash script in background

              • Akash Mittal
              • September 5, 2022
              Python subprocess library is used to run processes like bash script in the background. It can create new processes, connect with their input/output/error pipes and obtain their error codes. Code…
              View Post
              functions in carbon language
              • Carbon

                Functions in Carbon Language

                • Akash Mittal
                • September 4, 2022
                Functions in carbon language has the same role as in C, Php or any other functional language. It is used to separate a functionality for reuse. For example, a function…
                View Post
                loops in carbon language - for while break continue return
                • Carbon

                  Loops in Carbon Language – while, for, break, continue, return

                  • Akash Mittal
                  • September 4, 2022
                  We can use for and while loops in carbon language. Within a loop the break and continue statements can be used for flow control. while Loop while loop in carbon…
                  View Post
                  switch match conditional in carbon language
                  • Carbon

                    Switch (Match) Conditional in Carbon Language

                    • Akash Mittal
                    • September 4, 2022
                    In Carbon language we don’t have switch statement. Else we have match. match is a control flow similar to switch of C and C++ and mirrors similar constructs in other languages, such as…
                    View Post
                    ternary operator if expression in carbon
                    • Carbon

                      Ternary Operator (If expressions) in Carbon

                      • Akash Mittal
                      • September 4, 2022
                      Ternary operators are generally used to return a value based on conditions in a single statement. This prevents unnecessary variable declarations and memory consumption. In Carbon we have if expressions…
                      View Post

                      Posts navigation

                      Previous 1 … 17 18 19 … 30 Next

                      Learn ReactJS & React Native With Me
                      Copyright AkashMittal.com | Privacy Policy