«کتاب تفکر سیستمی نوشتهٔ جمشید قراچه داغی» از جمله کتابهای مطرح این حوزه در سطح جهان است و بسیاری از دانشگاهها و مراکز عالی به عنوان منبع و مرجع آموزش نگرش سیستمی استفاده میکنند.
امروزه اگر قرار باشد از چهار یا پنج فرد برتر در حوزهٔ تفکر سیستمی در سطح جهان نام ببریم، نام جشمید قراچه داغی هم در این فهرست وجود خواهد داشت و در کنار کسانی مانند پیتر سنگه و راسل اکاف قرار میگیرد.
Forwarded from Dev communicates (Pourya Daneshvar)
🎯 I was asked this in a recent interview:
"How do you deep copy an object in JavaScript?"
It might sound simple, but it’s one of those questions that reveal how well you really understand the language.
Shallow vs Deep Copy, what’s the difference?
In JavaScript, shallow copy and deep copy refer to how data structures (especially objects and arrays) are duplicated. The key difference lies in how nested objects or arrays are handled.
🔹 Shallow Copy
A shallow copy copies only the first level of the object or array. Nested objects or arrays are still referenced, not duplicated.
🔧 Tools for shallow copy:
- Object.assign({}, obj)
- Spread syntax: { ...obj }, [ ...array ]
- Array.prototype.slice()
🔹 Deep Copy
A deep copy duplicates everything, including nested objects. Changes in the copy won’t affect the original.
🔧 Tools for deep copy:
- structuredClone(obj) (✅ modern, built-in)
- JSON.parse(JSON.stringify(obj)) (⚠️ may fail with functions, undefined, circular refs)
- Libraries: lodash.cloneDeep(obj)
Use the right one depending on your data structure and avoid hidden bugs in your app!
#javascript
"How do you deep copy an object in JavaScript?"
It might sound simple, but it’s one of those questions that reveal how well you really understand the language.
Shallow vs Deep Copy, what’s the difference?
In JavaScript, shallow copy and deep copy refer to how data structures (especially objects and arrays) are duplicated. The key difference lies in how nested objects or arrays are handled.
🔹 Shallow Copy
A shallow copy copies only the first level of the object or array. Nested objects or arrays are still referenced, not duplicated.
🔧 Tools for shallow copy:
- Object.assign({}, obj)
- Spread syntax: { ...obj }, [ ...array ]
- Array.prototype.slice()
🔹 Deep Copy
A deep copy duplicates everything, including nested objects. Changes in the copy won’t affect the original.
🔧 Tools for deep copy:
- structuredClone(obj) (✅ modern, built-in)
- JSON.parse(JSON.stringify(obj)) (⚠️ may fail with functions, undefined, circular refs)
- Libraries: lodash.cloneDeep(obj)
Use the right one depending on your data structure and avoid hidden bugs in your app!
#javascript
LinkedIn
LinkedIn Login, Sign in | LinkedIn
Login to LinkedIn to keep in touch with people you know, share ideas, and build your career.
interface User {
name: string;
age: number;
email: string;
}
const updateUser =
(user: Partial<User>) => ({
... user, updatedAt: new Date(),
}):
updateUser ({ name: "John" }) ;interface User {
name: string;
age: number;
email: string;
}
const updateUser =
(user: ?????) => ({
... user, updatedAt: new Date(),
}):
updateUser ({ name: "John" }) ;#macos installer
softwareupdate --list-full-installers
softwareupdate --fetch-full-installer --full-installer-version 26.x
Forwarded from javad
این هم بدرد میخوره:
https://runflare.com/mirrors/
https://runflare.com/mirrors/
رانفلر | سکوی ابری - سرویس ابری - هاست ابری
Runflare Mirror - رانفلر | سکوی ابری - سرویس ابری - هاست ابری
Runflare Mirror در رانفلر برخی از مخزن ها و کتابخانه های مورد نیاز برنامه نویسان را به صورت mirror آماده ساخته ایم تا مشکل اختلال های اینترنت و محدودیت های زیر ساخت کشور در ارتباط با اینترنت بین الملل برای کاربران ما برطرف شود. از این لحظه شما می توانید با…