Dino Geek, try to help you

What is the difference between a function and a procedure in JavaScript?


In JavaScript, there isn’t technically a distinction between a function and a procedure. Both terms refer to blocks of code that are designed to perform a particular task.

However, in general programming terminology, there’s a slight difference between the two.

A function is a piece of code that takes input (parameters), performs some computation on them, and returns a result (output). Functions are expected to produce outputs and should always return a value.

On the other hand, a procedure performs a task but does not return a value. They’re typically used for their side effects, such as modifying the contents of a variable or altering the state of the program. They’re more about action than about producing a result.

In JavaScript, you might consider a function without a return statement to be a procedure. However, it’s worth noting that even without a return statement, JavaScript functions still return a value, implicitly returning undefined. So technically, there are no true “procedures” in Javascript.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use