A Professional based out of India specialized in handling AI-powered automations. Contact me at ranjancse@gmail.com, LinkedIn - https://www.linkedin.com/in/ranjan-dailata/
function deepClone(obj) {
// Check if the input is an object
if (obj === null || typeof obj !== 'object') {
return obj;
}
return JSON.parse(JSON.stringify(obj));
}
Improved code for deep cloning of objects.
Thankyou Ranjan for your contribuition π
Further improved code - use the native structuredClone:
Faster, less problems, more options.
this is π₯
Hi.
You can add
jsnext to the opening backticks to have syntax highlight.Also note that
JSON.stringifywill work as you'd expect if properties are booleans, numbers etc. Functions, Maps, Sets will be omitted or null'd.Check the doc for more info.
Thankyou so much julien, i really don't know about this
jssyntax feature of dev to.It can be any supported language too.
etc
Thank you. For #5, Is it dublicate or duplicate?
Sorry its duplicate π Thankyou for informing me
You're welcome
Awesome tips Taqui, thanks for sharing them
Looking coolπ₯, how can I add buttons and follow me sections like you.
It is called CTA(call to action) button.
This is the syntax to add CTA π Button
π