Notice: file_put_contents(): Write of 2994 bytes failed with errno=28 No space left on device in /var/www/tgoop/post.php on line 50

Warning: file_put_contents(): Only 12288 of 15282 bytes written, possibly out of free disk space in /var/www/tgoop/post.php on line 50
JavaScript@javascript P.2438
JAVASCRIPT Telegram 2438
CHALLENGE

const cache = new WeakMap();

const user1 = { name: 'Alice' };
const user2 = { name: 'Bob' };

cache.set(user1, { lastLogin: 'yesterday' });
cache.set(user2, { lastLogin: 'today' });

const result = [];
result.push(cache.has(user1));
result.push(cache.get(user2).lastLogin);

let user3 = { name: 'Charlie' };
cache.set(user3, { lastLogin: 'now' });
result.push(cache.has(user3));

user3 = null; // Removing the reference
// Garbage collector might run here in real situations

const user4 = { name: 'Charlie' }; // Same name, different object
result.push(cache.has(user4));

console.log(result);
5



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

CHALLENGE

const cache = new WeakMap();

const user1 = { name: 'Alice' };
const user2 = { name: 'Bob' };

cache.set(user1, { lastLogin: 'yesterday' });
cache.set(user2, { lastLogin: 'today' });

const result = [];
result.push(cache.has(user1));
result.push(cache.get(user2).lastLogin);

let user3 = { name: 'Charlie' };
cache.set(user3, { lastLogin: 'now' });
result.push(cache.has(user3));

user3 = null; // Removing the reference
// Garbage collector might run here in real situations

const user4 = { name: 'Charlie' }; // Same name, different object
result.push(cache.has(user4));

console.log(result);

BY JavaScript


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

View MORE
Open in Telegram


Telegram News

Date: |

Matt Hussey, editorial director of NEAR Protocol (and former editor-in-chief of Decrypt) responded to the news of the Telegram group with “#meIRL.” Judge Hui described Ng as inciting others to “commit a massacre” with three posts teaching people to make “toxic chlorine gas bombs,” target police stations, police quarters and the city’s metro stations. This offence was “rather serious,” the court said. Choose quality over quantity. Remember that one high-quality post is better than five short publications of questionable value. To view your bio, click the Menu icon and select “View channel info.” As five out of seven counts were serious, Hui sentenced Ng to six years and six months in jail.
from us


Telegram JavaScript
FROM American