Javascript Question

Hello,
i have some JS code in the change event of a form:
this.kennzeichendata = { ...this.kennzeichendata, KennzTeil1: event.value.toUpperCase(), Kennzeichen: event.value + '-' + (this.kennzeichendata.KennzTeil2 || '') + ' ' + (this.kennzeichendata.KennzTeil3 || '')}

kennzeichendata is set in the pageload event:

I am a js beginner and its not clear to me what ...this.kennzeichendata, do. What are these 3 dots for?
I am thankful about some clarity about this. Searching for that "..." but cant find anything about that. Only if the 3 dots are used as variable paramters. But not in an object assignment.

Kind Regards
Thomas

The three dots are the so called spread operator. What it does in this case is to create a new JS object which has the properties of kennzeichendata and two new properties - Kennzeichen and KennzTeil.

Hi Atanas,
the properties “Kennzeichen” und “KennzTeil1” are already members of “kennzeichendata”. As far as i understand this, is that “kennzeichendata” are all the form0 properties/fields that are listed in the designer.for form0.
If i add a new property i can use it as i like for internal purposes. the kennzeichendata object is automatically “expanded” by the this new property.
is that right?
And the “…” is like a “new()” in Java or c#!?

Regards
Thomas

what i said doesnt fit…
the kennzeichendata object must be more than the form properties…
i think so because the kennzeichendata object is set in the pageload event with ${{}}.
So the question is… What is “${{}}” ? :slight_smile:

Where can i read about those constructs? an Angular tutorial? Or Javascript?
As i long time c, c++, c#, vb, java programmer those notation as “${{}}” are very irritating to me :slight_smile:

Regards
Thomas

Hi Thomas,

The spread syntax is used here to create a new JS object which contains the properties of kennzeichendata and the new ones. JavaScript objects can be defined as literals e.g. var obj = { prop1: 'value1', prop2: 'value2' }. The {} is an empty object. The ${} part is Radzen specific and is used to embed property values and get autocomplete. You could have used just {} instead of ${{}} because no page properties are involved.

MDN is an excellent learning resource for JavaScript. And nothing beats the official Angular tutorials.

Thank you Atanas! I will have a (long time) look at this :slight_smile:

kind regards
Thomas