ak47akshat
ak47akshat
Untitled
4 posts
Don't wanna be here? Send us removal request.
ak47akshat · 4 months ago
Text
The many ways of specifying parameters in Javascript
1) Taking Parameters as they are : function fn(args){ console.log(args); } fn('orange','apple','grapes'); //orange There are 2 arguments being passed, but writing the parameters in the above syntax in Javascript will only make it consider the first argument. 2) The Rest Operator … function fn(arg1,...args){ console.log(args); } fn('orange','apple','grapes'); //[ 'apple', 'grapes' ] The…
0 notes
ak47akshat · 4 months ago
Text
Can you copy local storage from one browser to another?
Copying local storage of one browser to another browser is fairly simple. Go to the browser you want to copy the local storage of, and in the console write the command copy(localstorage). Now go the browser where you want to paste the copied local storage, and write the following piece of code : const obj= press ctrv…
0 notes
ak47akshat · 4 months ago
Text
Understanding batching of State Updates In React
In React, every time a state is updated using the setState callback function, a re-render is caused, right? No. This statement is not entirely true, because it sort of implies that for n state updates there will be n number of re-renders. The truth is that the number of re-renders depend on how and where the state updates happen.If all the n state updates happen in independent functions, there…
0 notes
ak47akshat · 4 months ago
Text
Country, Currency, alpha2, alhpa3, phone code, and numeric, All in one place
export const COUNTRIES = [ { label: 'Afghanistan', alpha2: 'AF', alpha3: 'AFG', numeric: '004', currency: 'AFN', phoneCode: '+93' }, { label: 'Albania', alpha2: 'AL', alpha3: 'ALB', numeric: '008', currency: 'ALL', phoneCode: '+355' }, { label: 'Algeria', alpha2: 'DZ', alpha3: 'DZA', numeric: '012', currency: 'DZD', phoneCode: '+213' }, { label: 'American Samoa', alpha2: 'AS', alpha3: 'ASM',…
1 note · View note