# \`on start\` tab confused how to use

**URL:** <https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353>\
**Category:** General\
**Created:** [6 January 2024 21:15 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353 "2024-01-06T21:15:43Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2024 22:20 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/22 "2024-01-06T22:20:29Z")

</div>

But thanks for showing me that.

It is now a problem of me REMEMBERING it for future use. CRAFT disease is getting worse for me. 😉

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [6 January 2024 22:21 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/23 "2024-01-06T22:21:30Z")

</div>

```auto
function HelloWorld(){
    return "Hello"
}

```

AND

```auto
const HelloWorld = () => {
    return "Hello"
}

```

are no different on the surface

arrow functions are "new" if that is the right word, but do allow to use surrounding context

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2024 22:22 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/24 "2024-01-06T22:22:00Z")

</div>

Where would that go?

I don't mind the alternatives being suggested, but alas I shall say/state:

I am still very much at the start/bottom of the learning curve of JavaScript and the command/syntax.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2024 22:22 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/25 "2024-01-06T22:22:56Z")

</div>

Ok.

Again: Handy to know. But will it survive CRAFT disease?

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [6 January 2024 22:23 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/26 "2024-01-06T22:23:44Z")

</div>

In the subflow JSON that you shared

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2024 22:25 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/27 "2024-01-06T22:25:29Z")

</div>

Sorry, but you are going to have to be more clear on what that means.

(not against you, but it is sort of worrying how people think I am smarter than I am.)  
I really know only just above nothing about Node-Red/JavaScript and most languages.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [6 January 2024 22:25 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/28 "2024-01-06T22:25:40Z")

</div>

Its a rabbit hole

Taking these examples...

```auto
function Hello(){
   return this.world // returns the property `world` from the "parent" that called Hello
}

```

```auto
const Hello = () > {
   return this.world // returns the property `world` from the "parent" that this code resides 
}

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2024 22:27 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/29 "2024-01-06T22:27:03Z")

</div>

So the `this.` is a ...... _command_ ?

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [6 January 2024 22:28 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/30 "2024-01-06T22:28:17Z")

</div>

it relates to the context it is being called from

> **[JavaScript this](https://www.w3schools.com/js/js_this.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2024 22:29 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/31 "2024-01-06T22:29:11Z")

</div>

Thanks, but I am now floundering.

I'll try to remember that as it seems like a handy trick to know.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [6 January 2024 22:33 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/32 "2024-01-06T22:33:56Z")

</div>

think of `this` as the body of code calling another body of code (there is more to it off course)

a `function` will treat `this` as the thing that called it  
an `arrow function` will treat `this` as the body of code that this `arrow function` lives

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2024 22:40 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/33 "2024-01-06T22:40:19Z")

</div>

Yeah, ok.

But please understand I have no....... base knowledge...... about it.

So I can see what you say, but the deeper meaning - and the ability to know how to use it in the future is not really there.

Most of my stuff is done badly - as I make a lot of mistakes.  
Yes, I have got better over the past..... _x_ years since I first started.

But taking this new knowledge and applying it to all my old code is near impossible for me as it wasn't written in the nicest way.

I have spent a lot of time recently having to restructure a lot of code because mistakes raised their heads and made a lot of pain for me when something unexpected happened.

Kind of good, but also painful with all the rewriting of code.

This even newer stuff is........ conceptual for me.  
I can see it, and sort of understand it, but I don't know where/how to put it in my brain so I know where it is next time I need it.

So as good as it is, if I can't index it correctly, it becomes lost with all the other stuff.

But sincerely: Thanks.

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [7 January 2024 17:47 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/34 "2024-01-07T17:47:48Z")

</div>

Copy the code snippet in to a function node, with lots of comments about how and where it was used etc  
Then save that to your library with a meaningful name, so you can find it next time you want it 😉

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/ae2d4e4f23ebbb9b0dee176bbf763aab84c4b5f7.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 January 2024 17:48 UTC](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353/35 "2024-01-21T17:48:23Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/on-start-tab-confused-how-to-use/84353.md?page=1)
