-->

ABOUT US

Our development agency is committed to providing you the best service.

OUR TEAM

The awesome people behind our brand ... and their life motto.

  • Kumar Atul Jaiswal

    Ethical Hacker

    Hacking is a Speed of Innovation And Technology with Romance.

  • Kumar Atul Jaiswal

    CEO Of Hacking Truth

    Loopholes are every major Security,Just need to Understand it well.

  • Kumar Atul Jaiswal

    Web Developer

    Techonology is the best way to Change Everything, like Mindset Goal.

OUR SKILLS

We pride ourselves with strong, flexible and top notch skills.

Marketing

Development 90%
Design 80%
Marketing 70%

Websites

Development 90%
Design 80%
Marketing 70%

PR

Development 90%
Design 80%
Marketing 70%

ACHIEVEMENTS

We help our clients integrate, analyze, and use their data to improve their business.

150

GREAT PROJECTS

300

HAPPY CLIENTS

650

COFFEES DRUNK

1568

FACEBOOK LIKES

STRATEGY & CREATIVITY

Phasellus iaculis dolor nec urna nullam. Vivamus mattis blandit porttitor nullam.

PORTFOLIO

We pride ourselves on bringing a fresh perspective and effective marketing to each project.

Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts
  • Render HTML and JSON Data in expressjs

     

    Render HTML and JSON Data in expressjs

     

     

    Render HTML and JSON Data in expressjs

     

    Hello viewers, whats up!! Here i am back again with the new series of  Nodejs. Node.js is an open-source, cross-platform JavaScript runtime environment that allows developers to run JavaScript code outside of a web browser. It is built on the V8 JavaScript runtime engine, which is the same engine that powers the Google Chrome browser. 

    Node.js is commonly used for building APIs (Application Programming Interfaces). You can create RESTful APIs or GraphQL APIs using Node.js to handle HTTP requests and serve data to client applications.

     

    Key features of Node.js include:

     

    # Asynchronous - Node.js is designed to be asynchronous, meaning it can handle a large number of concurrent connections without the need for multithreading.

    # Single-threaded, Non-blocking I/O - Node.js uses a single-threaded event loop to manage asynchronous operations.

    # npm (Node Package Manager): npm is the default package manager for Node.js, allowing developers to easily manage and install libraries and dependencies for their projects.

    # Server-Side Development: Node.js is commonly used for server-side development, where it excels at handling real-time, data-intensive applications, such as chat applications, online gaming, and streaming services.

     

    But Why we are using Expressjs Here, just because of incase if you want to make API using nodejs directly then its a very complex method to create API and integrate directly thats why we are using Expressjs framework and in this framework with the help, you can create RESTful API easily.




    Make Page using ExpressJS


    We will make first simple page in expressjs then we will adjust HTML and JSON data. Like this with explaination.


    const express = require('express')

    This line imports the Express framework into your script. express is a web application framework for Node.js that simplifies
    the process of creating web servers and handling HTTP requests and responses.



    const app = express()


    This line creates an instance of the Express application. This app object is the core of your web server and is used to define routes,
    middleware, and other settings.


    app.get('', (req, resp) => {
        resp.send("Welcome This is our Home Page")
    })



    app.get('/about',  (req, resp) => {
        resp.send("Welcome This is our About Page")
    })

    app.get('/contact', (req, resp) => {
        resp.send("Welcome This is our contact page")
    })

    This code defines a route for handling HTTP GET requests to the path /about. When a request is made to this endpoint, the server responds with a JSON object containing a message - Welcome This is our About Page or Home page or contact page.


    app.listen(5000)

    The app.listen() method starts the server and makes it listen for incoming requests on the specified port (3000 in this case).



    Now we will ready to change some code for Rendering HTML.

     

    Render HTML Data

     

    We are using Back Tick ( ` ` ) Here in resp.send - input tag and button tag.

     

     

    app.get('/about', (req, resp) => {
       resp.send(`
       <input type="text" placeholder="Enter your name"  />
       <button>Submit</button>
       `)
    })
    
    

     

     

     

    Render HTML and JSON Data in expressjs

    Render JSON Data

     

     We are using object to make JSON Data here.

     

    app.get('/contact', (req, resp) => {
       // resp.send("Welcome This is our contact page")
       resp.send([
        {
            name: 'Atul',
            email: 'kumaratuljaiswal222@gmail.com'
        },
        { 
            name: 'Kumar Atul Jaiswal',
            email: 'atulthehacker222@gmail.com'
        }
       ])
    })
    

     

     

    Render HTML and JSON Data in expressjs

     

     

    Now think about it if we can get value in input box from parameter then how we can achieve. Let's  code it.

     

    if we type parameter name with value in url like this - http://localhost:5000/about?name=atul. So but how we can code it actually.

    Don't worry visit this blog - CLICK HERE

     

     

    app.get('/about', (req, resp) => {
       resp.send(`
       <input type="text" placeholder="Enter your name" value="${req.query.name}" />
       <button>Submit</button>
       `)
    })
    
    

     

     


     

     

    Routing Page  


    With the help of anchor tag <a href=""></a> you can route where you want to redirecting when user click on it.



    app.get('', (req, resp) => {
        
        resp.send(`
        Welcom To Home Page
        <br />
        <a href="/about">Go To About Page</a>
        `);
    })
    
    
    

     

     


    # Install redux and saga packages - CLICK HERE

    # Make reducer wrapper - CLICK HERE

    # Action in reducer - CLICK HERE

    # Reducer in redux - CLICK HERE

    # Switch Stmt in redux - CLICK HERE

    # Get data in component from redux - CLICK HERE 

    # Remove from cart - CLICK HERE 

    # Add Redux Toolkit in react redux saga - CLICK HERE  

    # Configure MiddleWare saga - CLICK HERE   

    # Call API with Saga and Set Result in react redux saga - CLICK HERE    

    # Product list ui with API data in react redux saga - CLICK HERE    

    # Remove to Cart with ID react redux saga - CLICK HERE     

    # Add Routing and Make Cart Page - CLICK HERE   

    # Show Added To Cart Product with Price Calculation  - CLICK HERE  

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


  • Routing Params by request and response in expressjs

     

    Routing Params by request and response in expressjs

     

     

    Routing Params by request and response in expressjs

     

    Hello viewers, whats up!! Here i am back again with the new series of  Nodejs. Node.js is an open-source, cross-platform JavaScript runtime environment that allows developers to run JavaScript code outside of a web browser. It is built on the V8 JavaScript runtime engine, which is the same engine that powers the Google Chrome browser. 

    Node.js is commonly used for building APIs (Application Programming Interfaces). You can create RESTful APIs or GraphQL APIs using Node.js to handle HTTP requests and serve data to client applications.

     

    Key features of Node.js include:

     

    # Asynchronous - Node.js is designed to be asynchronous, meaning it can handle a large number of concurrent connections without the need for multithreading.

    # Single-threaded, Non-blocking I/O - Node.js uses a single-threaded event loop to manage asynchronous operations.

    # npm (Node Package Manager): npm is the default package manager for Node.js, allowing developers to easily manage and install libraries and dependencies for their projects.

    # Server-Side Development: Node.js is commonly used for server-side development, where it excels at handling real-time, data-intensive applications, such as chat applications, online gaming, and streaming services.

     

    But Why we are using Expressjs Here, just because of incase if you want to make API using nodejs directly then its a very complex method to create API and integrate directly thats why we are using Expressjs framework and in this framework with the help, you can create RESTful API easily.



    Make Page using ExpressJS


    const express = require('express')

    This line imports the Express framework into your script. express is a web application framework for Node.js that simplifies
    the process of creating web servers and handling HTTP requests and responses.



    const app = express()


    This line creates an instance of the Express application. This app object is the core of your web server and is used to define routes,
    middleware, and other settings.


    app.get('', (req, resp) => {
        resp.send("Welcome This is our Home Page")
    })



    app.get('/about',  (req, resp) => {
        resp.send("Welcome This is our About Page")
    })

    app.get('/contact', (req, resp) => {
        resp.send("Welcome This is our contact page")
    })

    This code defines a route for handling HTTP GET requests to the path /about. When a request is made to this endpoint, the server responds with a JSON object containing a message - Welcome This is our About Page or Home page or contact page.


    app.listen(5000)

    The app.listen() method starts the server and makes it listen for incoming requests on the specified port (3000 in this case).


    Whole Code

     

    const express = require('express')
    const app = express()
    
    
    app.get('', (req, resp) => {
        resp.send("Welcome This is our Home Page")
    })
    
    app.get('/about',  (req, resp) => {
        resp.send("Welcome This is our About Page")
    })
    
    app.get('/contact', (req, resp) => {
        resp.send("Welcome This is our contact page")
    })
    
    
    app.listen(5000)
    
    
    

     

     
     

    Save as index.js or whatever you want called as then run in terminal node index.js with the port number 5000.

     

     

     Make a page using ExpressJS framework

     

     Routing Params by request and response in expressjs

     

    Suppose that if we want parameter with value in url like this - http://localhost:5000/?name=atul

     


    app.get('', (req, resp) => {
        console.log("Data sent by browser --->> ", req.query)
        resp.send("Welcome This is our Home Page")
    })

     


    Let's run in terminal with the command - node index.js and after that in url (in browser's url) type ?query as a parameter and = equal to sign and then parameter's value and hit enter.

     

     

     


     

     In console here we  got a object { query: 'atul' }.

     

    And if we want only value as an output then write  console.log("Data sent by browser --->> ", req.query.name)

    http://localhost:5000/?name=atul

     



    Suppose if we want response in browser then we will write this code -



    app.get('', (req, resp) => {
        console.log("Data sent by browser --->> ", req.query.name)
        resp.send("Welcom " + req.query.name)
    })







    # Install redux and saga packages - CLICK HERE

    # Make reducer wrapper - CLICK HERE

    # Action in reducer - CLICK HERE

    # Reducer in redux - CLICK HERE

    # Switch Stmt in redux - CLICK HERE

    # Get data in component from redux - CLICK HERE 

    # Remove from cart - CLICK HERE 

    # Add Redux Toolkit in react redux saga - CLICK HERE  

    # Configure MiddleWare saga - CLICK HERE   

    # Call API with Saga and Set Result in react redux saga - CLICK HERE    

    # Product list ui with API data in react redux saga - CLICK HERE    

    # Remove to Cart with ID react redux saga - CLICK HERE     

    # Add Routing and Make Cart Page - CLICK HERE   

    # Show Added To Cart Product with Price Calculation  - CLICK HERE  

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


     
  • Make a page using ExpressJS framework

     

    Make a page using ExpressJS framework

     

     

    Make a page using ExpressJS framework

     

    Hello viewers, whats up!! Here i am back again with the new series of  Nodejs. Node.js is an open-source, cross-platform JavaScript runtime environment that allows developers to run JavaScript code outside of a web browser. It is built on the V8 JavaScript runtime engine, which is the same engine that powers the Google Chrome browser. 

    Node.js is commonly used for building APIs (Application Programming Interfaces). You can create RESTful APIs or GraphQL APIs using Node.js to handle HTTP requests and serve data to client applications.

     

    Key features of Node.js include:

     

    # Asynchronous - Node.js is designed to be asynchronous, meaning it can handle a large number of concurrent connections without the need for multithreading.

    # Single-threaded, Non-blocking I/O - Node.js uses a single-threaded event loop to manage asynchronous operations.

    # npm (Node Package Manager): npm is the default package manager for Node.js, allowing developers to easily manage and install libraries and dependencies for their projects.

    # Server-Side Development: Node.js is commonly used for server-side development, where it excels at handling real-time, data-intensive applications, such as chat applications, online gaming, and streaming services.

     

    But Why we are using Expressjs Here, just because of incase if you want to make API using nodejs directly then its a very complex method to create API and integrate directly thats why we are using Expressjs framework and in this framework with the help, you can create RESTful API easily.


    NOTE - After this blog we will create RESTFUL API using ExpressJS.



    Install ExpressJS


    npm i or npm install express - with this help you can install ExpressJS framework.






    Make Page using ExpressJS


    const express = require('express')

    This line imports the Express framework into your script. express is a web application framework for Node.js that simplifies
    the process of creating web servers and handling HTTP requests and responses.



    const app = express()


    This line creates an instance of the Express application. This app object is the core of your web server and is used to define routes,
    middleware, and other settings.


    app.get('', (req, resp) => {
        resp.send("Welcome This is our Home Page")
    })



    app.get('/about',  (req, resp) => {
        resp.send("Welcome This is our About Page")
    })

    app.get('/contact', (req, resp) => {
        resp.send("Welcome This is our contact page")
    })

    This code defines a route for handling HTTP GET requests to the path /about. When a request is made to this endpoint, the server responds with a JSON object containing a message - Welcome This is our About Page or Home page or contact page.


    app.listen(5000)

    The app.listen() method starts the server and makes it listen for incoming requests on the specified port (3000 in this case).


    Whole Code



    const express = require('express')
    const app = express()
    
    
    app.get('', (req, resp) => {
        resp.send("Welcome This is our Home Page")
    })
    
    app.get('/about',  (req, resp) => {
        resp.send("Welcome This is our About Page")
    })
    
    app.get('/contact', (req, resp) => {
        resp.send("Welcome This is our contact page")
    })
    
    
    app.listen(5000)
    


     

     Save as index.js or whatever you want called as then run in terminal node index.js with the port number 5000.

     

     

    Make a page using ExpressJS framework

     


    # Install redux and saga packages - CLICK HERE

    # Make reducer wrapper - CLICK HERE

    # Action in reducer - CLICK HERE

    # Reducer in redux - CLICK HERE

    # Switch Stmt in redux - CLICK HERE

    # Get data in component from redux - CLICK HERE 

    # Remove from cart - CLICK HERE 

    # Add Redux Toolkit in react redux saga - CLICK HERE  

    # Configure MiddleWare saga - CLICK HERE   

    # Call API with Saga and Set Result in react redux saga - CLICK HERE    

    # Product list ui with API data in react redux saga - CLICK HERE    

    # Remove to Cart with ID react redux saga - CLICK HERE     

    # Add Routing and Make Cart Page - CLICK HERE   

    # Show Added To Cart Product with Price Calculation  - CLICK HERE  

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


  • Make a RESTFul API in nodejs using ExpressJS

     

    Make a RESTFul API in nodejs using ExpressJS



    Make a RESTFul API in nodejs using ExpressJS

     

    Hello viewers, whats up!! Here i am back again with the new series of  Nodejs. Node.js is an open-source, cross-platform JavaScript runtime environment that allows developers to run JavaScript code outside of a web browser. It is built on the V8 JavaScript runtime engine, which is the same engine that powers the Google Chrome browser. 

    Node.js is commonly used for building APIs (Application Programming Interfaces). You can create RESTful APIs or GraphQL APIs using Node.js to handle HTTP requests and serve data to client applications.

     

    Key features of Node.js include:

     

    # Asynchronous - Node.js is designed to be asynchronous, meaning it can handle a large number of concurrent connections without the need for multithreading.

    # Single-threaded, Non-blocking I/O - Node.js uses a single-threaded event loop to manage asynchronous operations.

    # npm (Node Package Manager): npm is the default package manager for Node.js, allowing developers to easily manage and install libraries and dependencies for their projects.

    # Server-Side Development: Node.js is commonly used for server-side development, where it excels at handling real-time, data-intensive applications, such as chat applications, online gaming, and streaming services.

     

    But Why we are using Expressjs Here, just because of incase if you want to make API using nodejs directly then its a very complex method to create API and integrate directly thats why we are using Expressjs framework and in this framework with the help, you can create RESTful API easily.




    Install ExpressJS


    npm i or npm install express - with this help you can install ExpressJS framework.


    Make a RESTFul API in nodejs using ExpressJS



    RESTFUL API


    Importing the express module:

    const express = require('express');


    This line imports the Express framework into your script. express is a web application framework for Node.js that simplifies the process of creating web servers and handling HTTP requests and responses.

    Creating an Express application instance:



    const app = express();


    This line creates an instance of the Express application. This app object is the core of your web server and is used to define routes, middleware, and other settings.


    Setting the port number:

    const port = 5000;


    Here, the variable port is set to 3000. This is the port on which your server will listen for incoming requests. You can change this port number to any other valid port number.



    Defining a simple route:


    app.get('/api/hello', (req, res) => {
      res.json({ message: 'Hello, API!' });
    });


    This code defines a route for handling HTTP GET requests to the path /api/hello. When a request is made to this endpoint, the server responds with a JSON object containing a message property: {"message": "Hello, API!"}. The res.json() method sends a JSON response to the client.

    Starting the server:


    app.listen(port, () => {
      console.log(`Server is running on port ${port}`);
    });


    The app.listen() method starts the server and makes it listen for incoming requests on the specified port (3000 in this case).
    The callback function is executed once the server has started, and it logs a message to the console indicating that the server is running.

    To run this code, you would save it in a file (e.g., index.js or restful-api.js ) and execute it using the node command in the terminal:

    After running the script, you can open a web browser or use a tool like Postman to make a GET request to http://localhost:5000/api/hello and see the JSON response.



    Whole Code



    const express = require('express')
    const app = express();
    const port = 5000;
    
    app.get('/api/hello', (req, res) => {
      res.json({ message: 'Hello, API!, I am atul from kumaratuljaiswal.in' });
    });
    
    
    
    app.listen(port, () => {
      console.log(`Server is running on port ${port}`);
    });
    
    
    



    Make a RESTFul API in nodejs using ExpressJS


    Make a RESTFul API in nodejs using ExpressJS




    # Install redux and saga packages - CLICK HERE

    # Make reducer wrapper - CLICK HERE

    # Action in reducer - CLICK HERE

    # Reducer in redux - CLICK HERE

    # Switch Stmt in redux - CLICK HERE

    # Get data in component from redux - CLICK HERE 

    # Remove from cart - CLICK HERE 

    # Add Redux Toolkit in react redux saga - CLICK HERE  

    # Configure MiddleWare saga - CLICK HERE   

    # Call API with Saga and Set Result in react redux saga - CLICK HERE    

    # Product list ui with API data in react redux saga - CLICK HERE    

    # Remove to Cart with ID react redux saga - CLICK HERE     

    # Add Routing and Make Cart Page - CLICK HERE   

    # Show Added To Cart Product with Price Calculation  - CLICK HERE  

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


  • Handle Asynchronous Data in Javascript

     

    handle asynchronous data in  javascript


     

    Asynchronous in Javascript

     

    Hello viewers, whats up!! Here i am back again with the new post of asynchronous in javascript. Javascript is a high level programming language used for known as web development. With this you can create dynamic and interactive content on websites.

    Syntax is similar to that of other programming languages like java and C. It is client side scripting language and when we talk about its Data types , it is support various data types, including numbers, strings booleans objects, arrays and functions.


     

    Asynchronous 

     

    In JavaScript, asynchronous programming is a way to handle operations that might take some time to complete, such as reading from a file, making a network request, or waiting for a user input. Asynchronous programming helps prevent blocking the execution of code, allowing other tasks to continue while the asynchronous operation is being performed.

     

    Note - Asynchronous in Javascript = CLICK HERE

     

    How is it works?

     

    The asynchronous working process in JavaScript involves handling tasks that might take some time to complete without blocking the execution of the entire program. This is crucial for web development, where operations like fetching data from an API, reading files, or responding to user input may introduce delays.

     

     

    Let's code


    let a = 20;
    let b = 0;
    
    let waitingData = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve(30)
        }, 2000)
    })
    
    waitingData.then((data) => {
        b=data;
        console.log(a+b)
    })
    
    



    Explaination


    1) Variable Declaration

    let a = 20;
    let b = 0;



    Two variables, a and b, are declared and initialized with values 20 and 0, respectively.



    2) Promise Creation:



    let waitingData = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve(30)
        }, 2000)
    })



    A new Promise named waitingData is created.

    The promise executor function is provided, which has two parameters: resolve and reject.

    Inside the executor function, a setTimeout is used to simulate an asynchronous operation. After 2000 milliseconds (2 seconds), the promise is resolved with the value 30.



    3) Promise Handling:

    waitingData.then((data) => {
        b = data;
        console.log(a + b);
    })



    The then method is called on the waitingData promise, which registers a callback function to be executed when the promise is resolved.

    The callback function takes a parameter data, which is the resolved value of the promise (in this case, 30).

    Inside the callback, the variable b is assigned the value of data (which is 30).

    The sum of a and b (20 + 30) is then logged to the console, resulting in the output 50.



    Handle Asynchronous Data in Javascript



    # Install redux and saga packages - CLICK HERE

    # Make reducer wrapper - CLICK HERE

    # Action in reducer - CLICK HERE

    # Reducer in redux - CLICK HERE

    # Switch Stmt in redux - CLICK HERE

    # Get data in component from redux - CLICK HERE 

    # Remove from cart - CLICK HERE 

    # Add Redux Toolkit in react redux saga - CLICK HERE  

    # Configure MiddleWare saga - CLICK HERE   

    # Call API with Saga and Set Result in react redux saga - CLICK HERE    

    # Product list ui with API data in react redux saga - CLICK HERE    

    # Remove to Cart with ID react redux saga - CLICK HERE     

    # Add Routing and Make Cart Page - CLICK HERE   

    # Show Added To Cart Product with Price Calculation  - CLICK HERE  

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


  • Asynchronous in Javascript

     

    Asynchronous in Javascript


     

     

    Asynchronous in Javascript

     

    Hello viewers, whats up!! Here i am back again with the new post of asynchronous in javascript. Javascript is a high level programming language used for known as web development. With this you can create dynamic and interactive content on websites.

    Syntax is similar to that of other programming languages like java and C. It is client side scripting language and when we talk about its Data types , it is support various data types, including numbers, strings booleans objects, arrays and functions.


    Here we have a problem about Asynchronous execution in javascript. Question is  suppose that we have 3 execution in one program

    #    first one takes 2 seconds
    #    second one takes 5 seconds and
    #    third one takes 1 seconds

        
     

    but execution is coded in line by line first, second, third. So, in case of Asynchronous and yeah javascript is an Asynchronous language but which one is printed first. First we need to understand what is Asynchronous and how is it works?
        
        

    Asynchronous 

     

    In JavaScript, asynchronous programming is a way to handle operations that might take some time to complete, such as reading from a file, making a network request, or waiting for a user input. Asynchronous programming helps prevent blocking the execution of code, allowing other tasks to continue while the asynchronous operation is being performed.

     

     

    How is it works?

     

    The asynchronous working process in JavaScript involves handling tasks that might take some time to complete without blocking the execution of the entire program. This is crucial for web development, where operations like fetching data from an API, reading files, or responding to user input may introduce delays.

     

     

    Let's code

     

    setTimeout(() => {
        console.log("technically, I am the first person")
        }, 2000);   // 2 seconds
    
    
    setTimeout(() => {
    console.log("technically, I am the second person") 
    }, 5000);    // 5 seconds
    
    
    setTimeout(() => {
        console.log("technically, I am the third person") 
        }, 1000);   // 1 second 
    
        
    

     

     

     

    Asynchronous in Javascript

     

     


    # Install redux and saga packages - CLICK HERE

    # Make reducer wrapper - CLICK HERE

    # Action in reducer - CLICK HERE

    # Reducer in redux - CLICK HERE

    # Switch Stmt in redux - CLICK HERE

    # Get data in component from redux - CLICK HERE 

    # Remove from cart - CLICK HERE 

    # Add Redux Toolkit in react redux saga - CLICK HERE  

    # Configure MiddleWare saga - CLICK HERE   

    # Call API with Saga and Set Result in react redux saga - CLICK HERE    

    # Product list ui with API data in react redux saga - CLICK HERE    

    # Remove to Cart with ID react redux saga - CLICK HERE     

    # Add Routing and Make Cart Page - CLICK HERE   

    # Show Added To Cart Product with Price Calculation  - CLICK HERE  

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


  • let vs var using setTimeout in javascript

     

    let vs var using setTimeout in javascript

     

    let vs var using setTimeout in javascript

     

    Hello viewers, whats up!! Here i am back again with the new post of let vs var using setTimeout in javascript. Javascript is a high level programming language used for known as web development. With this you can create dynamic and interactive content on websites.

    Syntax is similar to that of other programming languages like java and C. It is client side scripting language and when we talk about its Data types , it is support various data types, including numbers, strings booleans objects, arrays and functions.


    Here we have a problem about setTimeout in javascript. Question is that there are two types of using var and let in setTimeout,  So, in javascript might be same but little bit difference because of if we use var with setTimeout and forloop then same number print many times (We will give you as many numbers as you want in the loop).

     when we use let in setTimeout and forloop then output is simple looping number printed.

     

    Let's Code

     

     

    for (var i=0; i<3; i++)
    {
        setTimeout(() => {
            console.log("When we use of var with setTimeout", i);  
        })
    }
    
    //www.kumaratuljaiswal.in
    
    for (let i=0; i<3; i++)
    {
        setTimeout(() => {
            console.log("when we use of let with setTimeout", i);
        })
    }
    

     

     

     

    let vs var using setTimeout in javascript

     

    Question from setTimeout in Javscript - CLICK HERE

     

     

     


    # Install redux and saga packages - CLICK HERE

    # Make reducer wrapper - CLICK HERE

    # Action in reducer - CLICK HERE

    # Reducer in redux - CLICK HERE

    # Switch Stmt in redux - CLICK HERE

    # Get data in component from redux - CLICK HERE 

    # Remove from cart - CLICK HERE 

    # Add Redux Toolkit in react redux saga - CLICK HERE  

    # Configure MiddleWare saga - CLICK HERE   

    # Call API with Saga and Set Result in react redux saga - CLICK HERE    

    # Product list ui with API data in react redux saga - CLICK HERE    

    # Remove to Cart with ID react redux saga - CLICK HERE     

    # Add Routing and Make Cart Page - CLICK HERE   

    # Show Added To Cart Product with Price Calculation  - CLICK HERE  

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


  • Question from setTimeout in Javscript

     

    Question from setTimeout in Javscript

     

    Hello viewers, whats up!! Here i am back again with the new post of question about setTimeout in javascript. Javascript is a high level programming language used for known as web development. With this you can create dynamic and interactive content on websites.

    Syntax is similar to that of other programming languages like java and C. It is client side scripting language and when we talk about its Data types , it is support various data types, including numbers, strings booleans objects, arrays and functions.


    Here we have a problem about setTimeout in javascript. Question is that there so 6 line of code in javascript. So simply use arrow function and for output we use console.log and after that we have to used setTimeout function and tell that what is the output and which output print first. Look like this -

     

    Code 

     

     

    (function() {
          console.log("a");
          setTimeout(() => console.log("b"), 1000);
          console.log("c");
          setTimeout(() => console.log("d"), 500);
    })();
    

     

     

     

    1) console.log("a"); - Outputs "a" to the console.


    2) setTimeout(() => console.log("b"), 1000); - Schedules the execution of the function () => console.log("b") after a delay of 1000 milliseconds (1 second).
       
     
    3) console.log("c"); - Outputs "c" to the console.
        

    4) setTimeout(() => console.log("d"), 500); - Schedules the execution of the function () => console.log("d") after a delay of 500 milliseconds (0.5 seconds).


    Now, let's consider the timing:


    #:/    "a" is logged immediately.
    #:/    "b" is scheduled to be logged after 1 second.
    #:/    "c" is logged immediately.
    #:/    "d" is scheduled to be logged after 0.5 seconds.


    However, JavaScript is single-threaded, and the event loop is used to manage the execution of asynchronous code. The scheduled functions (like "b" and "d") are placed in the event queue and executed when the call stack is empty.



    So, the output order will be:

     

     

        "a"
        "c"
        "d"
        "b"
    
    
    

     

     

    Question from setTimeout in Javscript

     

     

     


    # Install redux and saga packages - CLICK HERE

    # Make reducer wrapper - CLICK HERE

    # Action in reducer - CLICK HERE

    # Reducer in redux - CLICK HERE

    # Switch Stmt in redux - CLICK HERE

    # Get data in component from redux - CLICK HERE 

    # Remove from cart - CLICK HERE 

    # Add Redux Toolkit in react redux saga - CLICK HERE  

    # Configure MiddleWare saga - CLICK HERE   

    # Call API with Saga and Set Result in react redux saga - CLICK HERE    

    # Product list ui with API data in react redux saga - CLICK HERE    

    # Remove to Cart with ID react redux saga - CLICK HERE     

    # Add Routing and Make Cart Page - CLICK HERE   

    # Show Added To Cart Product with Price Calculation  - CLICK HERE  

     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     

     

  • How to fix Each child in a list should have a unique "key" prop in reactjs

     

    How to fix Each child in a list should have a unique "key" prop in reactjs

     

     

     ES6 Gives us a new syntax for defining functions using a fat arrwo. Arrow fucntions bring a lot of clarity & code reduction.

    ES6 is different version of the ECMAScript specification. Which is the standard that defines the scripting language that javascript is based on.

    ES6 release on 2015 and there are so many features Arrow function, classes, let and const for variables.

     

    React


    Certainly, reactjs is a JavaScript library developed by Facenook for building user interfaces. It allows developers to create reusable UI components and effciently manage the state of their applications. Here are some key aspects of Reactjs.


    Component-Based Architecture: ReactJS follows a component-based architecture, where the user interface is divided into small, reusable components. Components encapsulate their own logic, state, and rendering, making it easier to build and maintain complex user interfaces.


    Virtual DOM: ReactJS uses a virtual representation of the DOM (Document Object Model), known as the Virtual DOM. When the state of a component changes, React updates the Virtual DOM.


    JSX: JSX is a syntax extension for JavaScript used in React. It allows developers to write HTML-like code within JavaScript, making it easier to describe the structure and appearance of components. JSX code is transpiled to regular JavaScript using tools like Babel before being executed in the browser.



    Hooks: React introduced Hooks in version 16.8 as a way to use state and other React features in functional components. Hooks allow developers to write reusable logic and manage state within functional components without the need for class components. The most commonly used hooks are useState for managing state and useEffect for handling side effects such as fetching data or subscribing to events.


    React Router: React Router is a popular routing library for React applications. It enables developers to create single-page applications with multiple views and handles routing between different components based on the URL.


    State Management: React provides a flexible ecosystem of state management solutions. While React's built-in state management (useState ) is suitable for managing local component state, more complex applications may benefit from additional state management libraries like Redux. These libraries help manage global application state and provide predictable ways to update and access the state.



    ReactJS has gained widespread popularity due to its performance, reusability, and declarative approach to building user interfaces. It has large community. 

     

     

    Each child in a list should have a unique "key" prop 


    When we use this code like this we got an error in our outpage page "Each child in a list should have a unique "key" prop

     

     

    function MapWithBoxes() {
      const [movies, setMovies] = useState([1, 2, 3, 4, 5]);
      const boxes = movies.map(() => {
        return <Box/>
      });
    






    The "Each child in a list should have a unique 'key' prop" warning in React occurs when you render a list of components or elements (e.g., within a map function) without specifying a unique key prop for each item. React uses the key prop to efficiently update and reconcile the virtual DOM when items in a list change, so it's essential to provide a unique key for each item.

    To fix this warning, you need to assign a unique key to each element or component you're rendering in the list. Typically, you can use a unique identifier from your data or the index of the item as the key. Here's how you can fix it in your MapWithBoxes component:


    function MapWithBoxes() {
    
    
      const [movies, setMovies] = useState([1, 2, 3, 4, 5]);
      const boxes = movies.map(
        (item, index) => {
            return <Box key={index} />
        }
    )
    


     OR



    function MapWithBoxes() {
    
    
      const [movies, setMovies] = useState([1, 2, 3, 4, 5]);
      const boxes = movies.map(
        (item, index) => {
            return <Box key={item.id} />
        }
    )
    


     

     

    In this example, I'm using the item itself as the key since the movies array appears to contain unique items.


    How to fix Each child in a list should have a unique "key" prop in reactjs


    v



    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.


  • How to make boxes using map and useState in reactjs

     

    How to make boxes using map and useState in reactjs

     

     

     ES6 Gives us a new syntax for defining functions using a fat arrwo. Arrow fucntions bring a lot of clarity & code reduction.

    ES6 is different version of the ECMAScript specification. Which is the standard that defines the scripting language that javascript is based on.

    ES6 release on 2015 and there are so many features Arrow function, classes, let and const for variables.

     

    React


    Certainly, reactjs is a JavaScript library developed by Facenook for building user interfaces. It allows developers to create reusable UI components and effciently manage the state of their applications. Here are some key aspects of Reactjs.


    Component-Based Architecture: ReactJS follows a component-based architecture, where the user interface is divided into small, reusable components. Components encapsulate their own logic, state, and rendering, making it easier to build and maintain complex user interfaces.


    Virtual DOM: ReactJS uses a virtual representation of the DOM (Document Object Model), known as the Virtual DOM. When the state of a component changes, React updates the Virtual DOM.


    JSX: JSX is a syntax extension for JavaScript used in React. It allows developers to write HTML-like code within JavaScript, making it easier to describe the structure and appearance of components. JSX code is transpiled to regular JavaScript using tools like Babel before being executed in the browser.



    Hooks: React introduced Hooks in version 16.8 as a way to use state and other React features in functional components. Hooks allow developers to write reusable logic and manage state within functional components without the need for class components. The most commonly used hooks are useState for managing state and useEffect for handling side effects such as fetching data or subscribing to events.


    React Router: React Router is a popular routing library for React applications. It enables developers to create single-page applications with multiple views and handles routing between different components based on the URL.


    State Management: React provides a flexible ecosystem of state management solutions. While React's built-in state management (useState ) is suitable for managing local component state, more complex applications may benefit from additional state management libraries like Redux. These libraries help manage global application state and provide predictable ways to update and access the state.



    ReactJS has gained widespread popularity due to its performance, reusability, and declarative approach to building user interfaces. It has large community.

     


    How to make boxes using map and useState in reactjs

     

    This is a React functional component named MapWithBoxes that renders a list of boxes using the map method and a Box component. Let's break down the code and explain each part:


    1. Import Statements:

     

    import React, { useState } from "react";
    

     

     

     
    The code imports the React library and the useState hook from React. useState is used to manage state within functional components.

     

    2. MapWithBoxes Component:

     

    function MapWithBoxes() {
    

     

     
    This defines a functional component named MapWithBoxes.

     
    3. State Management:

     

    const [movies, setMovies] = useState([1, 2, 3, 4, 5]);
    

     

     
    This line initializes a piece of state named movies using the useState hook. The initial state is an array [1, 2, 3, 4, 5], which represents a list of movies (though the actual content is not used in this example).

     

    4. Mapping Over Movies:

     

    const boxes = movies.map(() => {
      return <Box />
    });
    
    
    
    
    

     

    This code uses the map function to iterate over the movies array. For each item in the array, it creates a Box component. The key prop is set to the index to help React efficiently update and render these components.


    5. JSX Rendering:

     

    return (
      <div/>
        <div className="max-w-[1240px] shadow-2xl min-h-[400px] mx-auto p-3 "/>
          {/* Input Element */}
        <input
            type="search"
            className="w-full border border-black rounded text-slate-500 p-4"
          />
    
          {/* Grid of Boxes */}
          <div className="w-full grid grid-cols-4 gap-5">{boxes}</div/>
        </div/>
      </div/>
    );
    
    
    
    
    

     


    Inside the return statement, there is JSX code that defines the component's layout.

    It includes an input element for searching (though it doesn't have any functionality in this example).

    The boxes array of Box components is rendered within a grid layout using the CSS classes provided.



    6. Box Component:
     

     

    const Box = () => {
      return <div className="shadow min-h-[200px] border border-black mt-3"/></div/>;
    };
    
    
    

     

     

    This defines a separate functional component named Box.

    The Box component renders a <div> element with some CSS classes to create a box-like appearance with shadows and borders.


    Output


    How to make boxes using map and useState in reactjs





    In summary, this React component MapWithBoxes renders a list of boxes using the map function to iterate over an array of movie items. Each box is created using the Box component, and the resulting boxes are displayed within a grid layout. This code example is a simplified template and doesn't include any actual movie data or search functionality.



     

    Disclaimer



    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


  • WHAT WE DO

    We've been developing corporate tailored services for clients for 30 years.

    CONTACT US

    For enquiries you can contact us in several different ways. Contact details are below.

    Hacking Truth.in

    • Street :Road Street 00
    • Person :Person
    • Phone :+045 123 755 755
    • Country :POLAND
    • Email :contact@heaven.com

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.