Skip to content
Top Bar

Pravin Varma

Web Developer | Photography | Graphic Design | Digital artwork | Photo editing

  • My Digital Artwork
  • Photography
  • View My Profile
Javascript

Using Karma plugin in IntelliJ IDEA to run individual test files

Dec 15, 2022 Pravin Varma Comments Off on Using Karma plugin in IntelliJ IDEA to run individual test files

If you are using IntelliJ IDEA and working on test cases and if you want to run test cases in a particular file or a

Javascript

useContext hook

Jul 28, 2022 Pravin Varma Comments Off on useContext hook

Most of the blogs provide code that has parent and child component placed in the same file. The context is available to both the component.

Javascript

React useMemo example with explanation

Jul 8, 2021 Pravin Varma Comments Off on React useMemo example with explanation

import React,{useMemo,useState} from “react”;import “./style.css”;export default function App() { const [state, setState] = useState(0); for(let i=1;i<10;i++){ let a=1; let b = 1; console.log(useMemo(()=> {console.log(‘invoked’);return a+b},[a,b]))

Javascript

Mapping useEffect with lifecycle hook methods in React

Jul 5, 2021 Pravin Varma Comments Off on Mapping useEffect with lifecycle hook methods in React

componentDidMount useEffect(() => { // will run on every render }); useEffect(() => { // will run on first render },[]); componentDidUpdate useEffect(() => {

Javascript

Prevent child from re-rendering in React using React.memo

Jun 19, 2021 Pravin Varma Comments Off on Prevent child from re-rendering in React using React.memo

This is the parent component import React,{useEffect, useState} from ‘react’; import ‘./style.css’; import Child1 from ‘./child1’; export default function App() { const [change, setChange] =

Javascript

Chaining of methods for Javascript object

Jun 11, 2021 Pravin Varma Comments Off on Chaining of methods for Javascript object

function Student() { this.obj = {}; this.setName = function(name) { this.obj.name = name; return this; }; this.setAge = function(age) { this.obj.age = age; return this;

Javascript

Using Karma plugin in IntelliJ IDEA to run individual test files

Dec 15, 2022 Pravin Varma 0
Javascript

useContext hook

Jul 28, 2022 Pravin Varma 0
Javascript

React useMemo example with explanation

Jul 8, 2021 Pravin Varma 0
Javascript

Mapping useEffect with lifecycle hook methods in React

Jul 5, 2021 Pravin Varma 0
Javascript

An interesting question of variable hoisting

Jan 17, 2018 Pravin Varma

var text = ‘outside’; function logIt (){ console.log(text); var text = ‘inside’; }; logIt(); If

Javascript

Function currying

Sep 23, 2017 Pravin Varma