GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    Axel Rauschmayer (rauschma@fosstodon.org)'s status on Tuesday, 31-Dec-2024 03:19:51 JSTAxel RauschmayerAxel Rauschmayer

    It’s a shame that JavaScript still has no built-in support for equality checks and that its support for cloning (not part of ECMAScript, but supported by virtually all platforms) has significant limitations—e.g., the clone of an instance of C is not an instance of C:

    class C {}
    const clone = structuredClone(new C());

    assert.equal(clone instanceof C, false);
    assert.equal(
    Object.getPrototypeOf(clone),
    Object.prototype
    );

    More information: https://2ality.com/2022/01/structured-clone.html

    #JavaScript

    In conversationabout 7 months ago from fosstodon.orgpermalink

    Attachments

    1. No result found on File_thumbnail lookup.
      `structuredClone()`: deeply copying objects in JavaScript
      Spreading is a common technique for copying objects in JavaScript: Spreading into an Array literal to copy an Array Spreading into an Object literal to copy a plain object Spreading has one significant downside – it creates shallow copies: The top levels are copied, but property values are shared. structuredClone() is a new function that will soon be supported by most browsers, Node.js and Deno. It creates deep copies of objects. This blog post explains how it works.
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.