# Difference between "keyword" and "function" - Javascript

**URL:** <https://forum.kirupa.com/t/difference-between-keyword-and-function-javascript/658307>\
**Category:** programming\
**Created:** [April 20, 2023, 8:50am UTC](https://forum.kirupa.com/t/difference-between-keyword-and-function-javascript/658307 "2023-04-20T08:50:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claudia\_Fetter](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/claudia_fetter/32/21619_2.png) [@Claudia\_Fetter](https://forum.kirupa.com/u/Claudia_Fetter)\
**Post date:** [April 20, 2023, 8:50am UTC](https://forum.kirupa.com/t/difference-between-keyword-and-function-javascript/658307/1 "2023-04-20T08:50:49Z")

</div>

Hey guys. I’m studying the book “Javascript - Absolute beginner’s guide”, and I’m a bit confused about the difference between “function” and “keyword”. Are they the same?  
So for example “let” is defined by the book as a keyword, whereas “alert” is a function. I’m not sure if I understood the difference between them completely.  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [April 20, 2023, 4:27pm UTC](https://forum.kirupa.com/t/difference-between-keyword-and-function-javascript/658307/2 "2023-04-20T16:27:00Z")

</div>

Hi @Claudia_Fetter - welcome to the forums! Hope you are also enjoying the book 🙂

One way to think about it is the following:

- A function is a reusable piece of code that performs a specific task
- A keyword is a reserved word (aka we _ **shouldn’t** _ use it for naming our own variables, functions, etc.) with a predefined meaning in the language

We can create our own functions, but keywords are defined by the JavaScript language. We can’t create new keywords.

Hope this helps.

Cheers,  
Kirupa 🙃

---

<div class="post-metadata">

**Author:** ![Claudia\_Fetter](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/claudia_fetter/32/21619_2.png) [@Claudia\_Fetter](https://forum.kirupa.com/u/Claudia_Fetter)\
**Post date:** [April 21, 2023, 2:30pm UTC](https://forum.kirupa.com/t/difference-between-keyword-and-function-javascript/658307/3 "2023-04-21T14:30:41Z")

</div>

Hi Kirupa,

definetely helped a lot! I borrowed the book in a local library where I live, but I’m planning to buy it once I have more resources, it is a very good book! Thank you for all the shared knowledge!

---

<div class="post-metadata">

**Author:** ![MindMade\_Technologie](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mindmade_technologie/32/21531_2.png) [@MindMade\_Technologie](https://forum.kirupa.com/u/MindMade_Technologie)\
**Post date:** [April 22, 2023, 9:42am UTC](https://forum.kirupa.com/t/difference-between-keyword-and-function-javascript/658307/4 "2023-04-22T09:42:35Z")

</div>

Yep, That’s right nice explanation.
