# Javascript Question

**URL:** <https://forum.radzen.com/t/javascript-question/335>\
**Category:** Uncategorized\
**Created:** [May 9, 2018, 7:20am UTC](https://forum.radzen.com/t/javascript-question/335 "2018-05-09T07:20:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [May 9, 2018, 7:20am UTC](https://forum.radzen.com/t/javascript-question/335/1 "2018-05-09T07:20:34Z")

</div>

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:

 ![image](https://forum.radzen.com/uploads/default/original/1X/f6734fdd53a3081d7a2cfcf5623790d4f2a4c3ec.png)

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

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [May 9, 2018, 8:31am UTC](https://forum.radzen.com/t/javascript-question/335/2 "2018-05-09T08:31:52Z")

</div>

The three dots are the so called [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax). 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.

---

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [May 9, 2018, 12:04pm UTC](https://forum.radzen.com/t/javascript-question/335/3 "2018-05-09T12:04:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [May 9, 2018, 12:10pm UTC](https://forum.radzen.com/t/javascript-question/335/4 "2018-05-09T12:10:22Z")

</div>

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 “${{}}” ? 🙂

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 🙂

Regards  
Thomas

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [May 9, 2018, 2:19pm UTC](https://forum.radzen.com/t/javascript-question/335/5 "2018-05-09T14:19:00Z")

</div>

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](https://developer.mozilla.org/bm/docs/Web/JavaScript) is an excellent learning resource for JavaScript. And nothing beats the [official Angular tutorials](https://angular.io/tutorial).

---

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [May 9, 2018, 2:53pm UTC](https://forum.radzen.com/t/javascript-question/335/6 "2018-05-09T14:53:38Z")

</div>

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

kind regards  
Thomas
