Skip to content

基础题,直接写出答案 #146

Open

Description

@sisterAn
let x = [1, 2, 3];
let y = x;
let z = [4, 5, 6];
y[0] = 10;
y = z;
z[1] = 20;
x[2] = z = 30;
console.log(x, y, z);

Activity

  1. U-LAN commented on Feb 25, 2021

    @U-LAN

    [10,2,30] [4,20,6] 30

  2. xllpiupiu commented on Oct 6, 2021

    @xllpiupiu
    x-->[1,2,3]
    y=x 即
    y-->[1,2,3]
    z-->[4,5,6]
    y[0]=10
    即[10,2,3]  
    y-->[4,5,6]
    z[1] = 20
    [4,20,6]
    z=30
    x[2]=z
    [10,2,30]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions