question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

new syntax for empty dynamic object

See original GitHub issue

As initially proposed in #6571, change the dynamic enumeration expression stuff so that:

dynamic obj = dynamic; //instantiate an empty object
dynamic obj = dynamic []; //instantiate an empty array

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:27 (25 by maintainers)

github_iconTop GitHub Comments

1reaction
gavinkingcommented, Oct 12, 2016

@lucaswerkmeister I find that it offends my aesthetic sense that spreading an empty thing has any effect at all upon the “invocation”.

0reactions
gavinkingcommented, Apr 6, 2018

is dynamic Object { ... } transformed to new Object()

Well, no, it would do the same thing that dynamic { ... } does right now, i.e. { ... }.

I guess dynamic Array { 1,2,3 } can be transformed to new Array(1,2,3), right?

I would transform it to [1, 2, 3].

And this not a breaking change?

I don’t think so, no.

Extremely verbose though.

That’s true.

Anyway, it’s just something to think about. I don’t see this as a high priority thing to do, not unless we come up with some other useful interpretation of dynamic Foo { ... } for something other new thing in JS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create an empty object in JavaScript with {} or new Object()?
new Object() and {} are not quite empty objects, they are objects that have the Object.prototype. You can use Object.create(null) for a truly ......
Read more >
Creating and Using Dynamic Objects (C# and Visual Basic)
Learn how to create and use dynamic objects in this walkthrough. ... In the Create a new project dialog, select C# or Visual...
Read more >
Creating and Modifying Dynamic Entities | Using JSON in Caché
For example, the following code creates an empty dynamic object and uses standard object dot syntax to define the contents: set dynArray =...
Read more >
Object initializer - JavaScript - MDN Web Docs - Mozilla
An object initializer is a comma-delimited list of zero or more pairs of property names and associated values of an object, enclosed in...
Read more >
How to Set Dynamic Property Keys with ES6 - Samantha Ming
Previously, we always had to use the bracket notation to use a dynamic key. With ES6, we can finally create dynamic variable key...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found