# I have a question about ux:Property and Javascript

**URL:** <https://forums.fusetools.com/t/i-have-a-question-about-ux-property-and-javascript/1540>\
**Category:** General\
**Created:** [July 20, 2017, 7:25am UTC](https://forums.fusetools.com/t/i-have-a-question-about-ux-property-and-javascript/1540 "2017-07-20T07:25:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@dev](https://forums.fusetools.com/u/dev)\
**Post date:** [July 20, 2017, 7:25am UTC](https://forums.fusetools.com/t/i-have-a-question-about-ux-property-and-javascript/1540/1 "2017-07-20T07:25:45Z")

</div>

```auto
<Panel ux:Class="SelectTest">
  <float ux:Property="Selected" />
  <JavaScript>
    console.log("selected index is " + this.Selected.value);
  </JavaScript>
</Panel>
<JavaScript>
var Observable = require("FuseJS/Observable");
 var selectedindex = Observable(5);
 module.exports = {
  selectedindex: selectedindex
 }
</JavaScript>
<SelectTest Selected="{selectedindex}" />

```

I think `selected index is 5` should appear.  
but, `selected index is 0` appears.

Why is not assigning `{selectedinedx}` to `Selected`?

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 20, 2017, 7:56am UTC](https://forums.fusetools.com/t/i-have-a-question-about-ux-property-and-javascript/1540/2 "2017-07-20T07:56:21Z")

</div>

That happens because you’re accessing the property imperatively. The properties are derived Observables, meaning that you can only access them using [reactive operators](https://www.fusetools.com/docs/fusejs/observable-api#reactive-operators).

The value in derived Observables is not available synchronously, and your `console.log()` runs before the value is populated. If you did the following, you should be alright:

```auto
this.Selected.inner().onValueChanged(module, function(x) {
    console.log("selected index is " + x);
});

```

Note the use of `.inner()` there - that may or may not be necessary, because it appears that you’re passing an Observable to the property. Since properties are implicitly available as Observables, you might end up with an Observable inside of another Observable.
