# How to Write a function?

**URL:** <https://discourse.nodered.org/t/how-to-write-a-function/62970>\
**Category:** General\
**Created:** [23 May 2022 15:46 UTC](https://discourse.nodered.org/t/how-to-write-a-function/62970 "2022-05-23T15:46:31Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 May 2022 20:24 UTC](https://discourse.nodered.org/t/how-to-write-a-function/62970/9 "2022-05-26T20:24:16Z")

</div>

> [@fredshortlv129bis](#):
>
> What is still not clear to me : is the syntax of the return payload JS or JSon

JSON stands for JavaScript Object Notation

Read this post I wrote some time back - I think it's fairly clear for folk new to all this.

> [@Object vs strings - extract a value from a split](https://discourse.nodered.org/t/object-vs-strings-extract-a-value-from-a-split/42112/2):
>
> You need to understand the differnece (and advantage) of using objects and properties in node-red (and JavaScript in general). For example, if you have an object, there is ZERO need to split strings etc. JSON stands for JavaScript Object Notation - meaning it is a string representation of a JS object - which is useful for transmitting between devices and across the internet (they all do strings right!). That is why JSON is so popular - because it is REALLY EASILY convert to/from object/string…

---

_[View the full topic](https://discourse.nodered.org/t/how-to-write-a-function/62970)._
