How to declare a global variable in React?
If you need to declare a global variable in React, then you can do the following:
Create a file called config.js
module.exports = global.config = { …
Read Article →
94 articles about javascript development, tools, and best practices
If you need to declare a global variable in React, then you can do the following:
Create a file called config.js
module.exports = global.config = { …
Read Article →
An Arithmetic Progression is defined as one in which there is a constant difference between the consecutive terms of a given series of …
Read Article →The main idea is to count all the occurring characters in a string. If you have a string like aba
, then the result should be {'a': 2, …
Use the following code block to get started:
function GetCount() {
const [count, setCount] = useState(1);
const incrementCounter = () => { …
Read Article →
If you have gotten this error before, then you have been trying to implement a rowData
mapping onto Ag-Grid.. and failed!
ImmutableService requires …
If you have an Ag-Grid, and want to automatically resize all the columns to fit the width of the viewport, you can use this hack.
The easiest way to get the content of all rows’ data, back into a Javascript/Typescript array, is as follows.
Simply create a blank array, then …
Read Article →Ever wanted to generate a CSV (comma separated values) file directly from the browser, using Javascript? Instead of going to the server..
Look no …
Read Article →If you have a single-digit number, and you need to format it to always have at-least two digits, then you can use the below function to solve your …
Read Article →Below is a nice little Javascript RegularExpression to validate email addresses.
/^\w.+@[a-zA-Z_.]+?\.[a-zA-Z.]{2,3}$/
..and to use it..
if …
Read Article →
E.g. URL:<br>http://example.com/?option=1&task=2&listing_id=36&layout=4&table=5#some_hash_value_here
So how would you get the …
Read Article →It seems to be quite a popular question with not as many answers to hold the weight.
Google Analytics has always been more of a pageviews type …
Read Article →