Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

语法支持:移动值到属性中 #4

Closed
XYZboom opened this issue Apr 27, 2024 · 2 comments
Closed

语法支持:移动值到属性中 #4

XYZboom opened this issue Apr 27, 2024 · 2 comments

Comments

@XYZboom
Copy link
Collaborator

XYZboom commented Apr 27, 2024

期望以下的功能:

let a = {};
let c = {};
c.a = 1;
a.x = c;
// 期望一个将c移动到a.x中的功能,不是复制
@XYZboom
Copy link
Collaborator Author

XYZboom commented Apr 27, 2024

准确来说,这个功能更期望是,将值移动到需要的变量中去

@Bylx666
Copy link
Owner

Bylx666 commented Apr 27, 2024

使用take函数:

let a = {};
let c = {};
c.a = 1;
a.x = take(c);
log(a,c)

@Bylx666 Bylx666 closed this as completed Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants