# Javascript to Bubble not Publishing Value

**URL:** <https://forum.bubble.io/t/javascript-to-bubble-not-publishing-value/211370>\
**Category:** Plugins\
**Created:** [June 15, 2022, 1:24pm UTC](https://forum.bubble.io/t/javascript-to-bubble-not-publishing-value/211370 "2022-06-15T13:24:29Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![samsonlcl](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@samsonlcl](https://forum.bubble.io/u/samsonlcl)\
**Post date:** [June 16, 2022, 1:08am UTC](https://forum.bubble.io/t/javascript-to-bubble-not-publishing-value/211370/17 "2022-06-16T01:08:32Z")

</div>

hi @matthewbuilds

Sorry for this late reply. Here is a simple case to apply the logic and hope you understand the return value better.

![image](https://us1.discourse-cdn.com/bubble/original/3X/0/a/0a9b8fc0bcf44564438fe1aa325462e127054c05.png)  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/b/3/b3387bee59cb76e05424c73b9e6dba39371c03d9.png)

If I call the function myValue with two parameter inside (money and incre), first the parameter money to pass to old, incre will pass to incre. It runs through each code (run the if condition to see if true or not), if the condition is true, then the function myValue will give you the value of old+incre (since this case the incre = 100, which is \> 50, so it return the result of 150). So, by using console.log(), you can see the value of 150.

Hope you understand what I am saying.

Samson @ Plugin Developer  
[Plugin Page](https://bubble.io/contributor/samson-lee-1654055812176x564745981083927700)  
[Plugin Forum](http://forum.bubble.io/t/ask-me-to-build-a-free-plugin-for-you/211009/18)

---

_[View the full topic](https://forum.bubble.io/t/javascript-to-bubble-not-publishing-value/211370)._
