JAVASCRIPT Telegram 2334
CHALLENGE

function modify(obj) {
obj.a.push(4);
obj.b = 'changed';
return obj;
}

const original = { a: [1, 2, 3], b: 'original', c: { deep: true } };
const copy1 = { ...original };
const copy2 = JSON.parse(JSON.stringify(original));

modify(copy1);
console.log(original.a, original.b, copy2.c === original.c);
👍51🤩1



tgoop.com/javascript/2334
Create:
Last Update:

CHALLENGE

function modify(obj) {
obj.a.push(4);
obj.b = 'changed';
return obj;
}

const original = { a: [1, 2, 3], b: 'original', c: { deep: true } };
const copy1 = { ...original };
const copy2 = JSON.parse(JSON.stringify(original));

modify(copy1);
console.log(original.a, original.b, copy2.c === original.c);

BY JavaScript


Share with your friend now:
tgoop.com/javascript/2334

View MORE
Open in Telegram


Telegram News

Date: |

Hui said the time period and nature of some offences “overlapped” and thus their prison terms could be served concurrently. The judge ordered Ng to be jailed for a total of six years and six months. To view your bio, click the Menu icon and select “View channel info.” The imprisonment came as Telegram said it was "surprised" by claims that privacy commissioner Ada Chung Lai-ling is seeking to block the messaging app due to doxxing content targeting police and politicians. Read now Public channels are public to the internet, regardless of whether or not they are subscribed. A public channel is displayed in search results and has a short address (link).
from us


Telegram JavaScript
FROM American