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

String Interpolation Issues #69

Closed
wgranger opened this issue Oct 10, 2017 · 4 comments
Closed

String Interpolation Issues #69

wgranger opened this issue Oct 10, 2017 · 4 comments

Comments

@wgranger
Copy link
Contributor

The client has an issue accepting the following string interpolation:
projectPreferences.update({preferences.tutorials_completed_at.${this.props.tutorial.id}: now});

This came up in a ZRC PR.

@rogerhutchings
Copy link
Contributor

Have you tried putting the key in backticks?

projectPreferences.update({`preferences.tutorials_completed_at.${this.props.tutorial.id}`: now});

@eatyourgreens
Copy link
Contributor

I think this might be a syntax error. The backticked expression should be in square brackets. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#Computed_property_names

@eatyourgreens
Copy link
Contributor

I'm going to close this, since it turns out to be a syntax error in the original javascript.

@wgranger
Copy link
Contributor Author

Sounds good. Thanks for the followup everyone.

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

3 participants