Sunny pfp

Sunny

@sunny90

283 Following
204 Followers


Sunny pfp
Sunny
@sunny90
Just joined the Ink guild. Continuing my brave quest to explore all corners of web3! guild.xyz/inkonchain
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
🔄 Tip: Use try...catch for error handling in async functions: try { await someFunc(); } catch (e) { console.error(e); }
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
🔧 Tip: Use Object.assign() to merge objects: const merged = Object.assign({}, obj1, obj2);
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
🔄 Tip: Use console.table() to display array or object data in a table format in the console.
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
Array.flat() method in JavaScript is used to flatten an array of arrays into a single-level array. const arr = [1, 2, [3, 4], [5, 6], 7]; const flatArr = arr.flat(); console.log(flatArr); // Output: [1, 2, 3, 4, 5, 6, 7]
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
âš¡ Tip: Use Array.flat() to flatten arrays: const flatArr = arr.flat();
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
GM, Weekends
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
âš¡ Tip: Use Array.flat() to flatten arrays: const flatArr = arr.flat();
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
🔥 Tip: Use Set to remove duplicates from an array: const unique = [...new Set(arr)];
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
🚀 Tip: Use optional chaining to safely access deeply nested object properties: const city = user?.address?.city;
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
🚀 Tip: Use destructuring to extract values from arrays or objects: const {name, age} = person;
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
💡 Tip: Use Array.some() or Array.every() to test if some or all array elements meet a condition
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
🔄 Tip: Use Array.reduce() to accumulate values: const total = numbers.reduce((acc, num) => acc + num, 0);
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
âš¡ Tip: Use Array.filter() to filter an array based on a condition: const evenNumbers = numbers.filter(n => n % 2 === 0);
0 reply
0 recast
1 reaction

Sunny pfp
Sunny
@sunny90
🔧 Tip: Use Array.map() to loop through and transform an array: const squared = numbers.map(n => n * n);
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
🔥 Tip: Use arrow functions for concise syntax and to avoid this binding issues: const sum = (a, b) => a + b;
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
🚀 Tip: Use template literals with backticks ` ` for easier string concatenation: let name = \Hello, ${firstName}``
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
GM, frontend. I am learning Frontend and want to share some small tip everyday. It is basic knowledge so that I want to note for myself. Tip: Use "let" and "const" instead of "var" to prevent scope issues. const for constants and let for variables that can change
0 reply
0 recast
0 reaction

Sunny pfp
Sunny
@sunny90
Flutter and React Native, Which one you refer?
0 reply
0 recast
1 reaction

Sunny pfp
Sunny
@sunny90
GM, We should store private key into an encrypted keystore instead using plain text in .env #solidity #foundry
0 reply
0 recast
0 reaction