DEV Community

Amira de Moya
Amira de Moya

Posted on

1 1

What Dah Function?

What dah Function?
By: Amira de Moya

There came a moment in life where I decided I needed a change. I found myself exploring different career paths on the web when I came across a blog on digital nomads. The picture of the girl on the beach, a new country, the hot sun, a coconut in one hand, computer on her lap, working on something that made a difference in the world (I imagined), just drew me in.

Months later it was Day 1 of Flatiron School Software Engineer Intensive. After making it through a month and a half of Prep Work, I was finally here and boy, did reality set in fast with JavaScript. I was doing fifteen-hour days and was really feeling like an imposter. For the life of me I could not grasp functions. I know this might sound very basic but as a Singer/Songwriter who dropped her computer science class in college after just one class, transitioning into tech would not be easy. I knew this! I was not deceived by the clever marketing that targeted my social media. However, with perseverance, a lot of practice, and Google, the synapse in my brain fired and functions, it finally clicked. So, if you are where I was, wondering if this is for you, head heavy with Imposter Syndrome, asking yourself “What Dah Function?”

Function

A function, a basic yet integral fabric of JavaScript is an action word. Instead of performing similar tasks individually, writing repetitive code, a function allows us to group similar tasks together. Then, when we call the function everything inside the swirly brackets {} gets executed giving us a result.

Function Declaration

A basic function is created with an expression that begins with the keyword function. It can be an anonymous or a named function as noted below.

function greet(){
console.log('Hello JavaScript Beginner');
}

greet();

// Hello JavaScript Beginner

or it can have a parameter or multiple parameters. A function has a body that contains a block of code to be executed once the function is called.

function greet(name){
console.log('Hello ‘ + name);
}

greet(‘Tavian’);

//Hello Tavian.

function greet (name, lastName) {
console.log('Hello ' + name + ' ' + lastName);
}

greet('Tavian', 'Braddick');

//Hello Tavian Braddick

Source:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions
Eloquent JavaScript Marjin Harvebeke

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay