Defining Functions
Functions are reusable blocks of code:
function greet(name) {\n return "Hello, " + name + "!";\n}\nconsole.log(greet("Shinobi")); // Hello, Shinobi!You can also use arrow functions:
const greet = (name) => `Hello, ${name}!`;Functions are reusable blocks of code:
function greet(name) {\n return "Hello, " + name + "!";\n}\nconsole.log(greet("Shinobi")); // Hello, Shinobi!You can also use arrow functions:
const greet = (name) => `Hello, ${name}!`;No comments yet. Be the first to ask a question!
Sign in to join the discussion.