Ajay Yadav ๐ŸŽฏ Profile picture
Mar 25 โ€ข 9 tweets โ€ข 3 min read
๐Ÿ’› Day 2๏ธโƒฃ3๏ธโƒฃ / 3๏ธโƒฃ0๏ธโƒฃ days of basics in JavaScript series!

โ†’ What is a function declaration?

โ†’ What is a function statement?

โ†’ What is function expression?

โ†’ Difference between function declaration & function expression?

โ†’ What is an anonymous function?

#javascript30
๐Ÿงตโ‡ฉ Image
๐Ÿ“Œ What is a function declaration?

โ†’ A function declaration always starts with the "function" keyword.

โ†’ The function declaration must have a function name. Image
๐Ÿ“Œ What is a function statement?

โ†’ The function statement is the synonym of the function declaration.

โ†’ Both are the same.
๐Ÿ“Œ What is function expression?

โ†’ This is also a function but without a function name.

โ†’ A function expression can be stored in a variable using the (=) assignment operator.

โ†’ The function can be assigned in a variable as a value using the (=) assignment operator.
โ†’ And they are always called(invoke / run) using the name of the variable.

โ†’ Here "squares" is the name of the variable. Image
๐Ÿ“Œ Difference between function declaration & function expression?

โ†’ The main difference is that function declaration is hoisted but not function expression.

โ†’ We can call/invoke the function declaration "after" and "before" the function definition. Image
โ†’ But function expression can only invoke/run/call "after" the function definition.

โ†’ If we call the function expression before initialization, then this will give an error.
๐Ÿ“Œ What is an anonymous function?

โ†’ A function without a name is called an anonymous function. Image
๐Ÿ’š That's all for now, we will meet in the next thread!

But if you like make sure to:

1. Follow me @ATechAjay

2. Retweet the first tweet.

3. Turn on the notification to never miss these amazing tweets.

Thank you so much for staying to the end of this thread.

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Ajay Yadav ๐ŸŽฏ

Ajay Yadav ๐ŸŽฏ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @ATechAjay

Mar 27
๐Ÿ’› Day 2๏ธโƒฃ6๏ธโƒฃ / 3๏ธโƒฃ0๏ธโƒฃ days of basics in JavaScript series!

โ†’ What is an array?

โ†’ How many types of creating an array?

โ†’ How to access array items & full array?

โ†’ How to change the array items?

โ†’ The data type of the array?

#javascript30

๐Ÿงตโ‡ฉ Image
๐Ÿ“Œ What is an array?

โ†’ It is a special variable that can be store more than one value.

โ†’ If you have multiple data items then you can use an array for storing those items.

โ†’ It can hold many values in a single variable.
โ†’ Or, storing a collection of multiple items in a single variable.

โ†’ Js array can contain mixed types of data or items, like string, decimal, float, boolean, etc.
Read 11 tweets
Mar 26
๐Ÿ’› Day 2๏ธโƒฃ5๏ธโƒฃ / 3๏ธโƒฃ0๏ธโƒฃ days of basics in JavaScript series!

โ†’ How many types of functions are in JavaScript?

โ†’ With explanations as well as examples!

#javascript30

Let me explain!๐Ÿงตโ‡ฉ Image
๐Ÿ“Œ How many types of functions are in JavaScript?

โ†’ There are 3 types of function is javaScript

1๏ธโƒฃ Function declaration/statement
2๏ธโƒฃ Function expression
3๏ธโƒฃ Arrow function
1๏ธโƒฃ Function declaration/statement

2๏ธโƒฃ Function expression

โ›” Learn it from this thread!๐Ÿ‘€๐Ÿ‘‡

Read 5 tweets
Mar 25
๐Ÿ’› Day 2๏ธโƒฃ4๏ธโƒฃ / 3๏ธโƒฃ0๏ธโƒฃ days of basics in JavaScript series!

โ†’ What is an arrow function?

โ†’ What is the syntax of the arrow function?

#javascript30

Let me explain!๐Ÿงตโ‡ฉ Image
๐Ÿ“Œ What is an arrow function?

โ†’ This is also similar to function declaration or function expression.

โ†’ Arrow function was introduced in ES6(2015).

โ†’ It allows us to define a function with an arrow (=>) symbol.
๐Ÿ“Œ What is the syntax of the arrow function?

โ†’ This is the simple syntax of the arrow function

๐—ฃ๐—ฎ๐—ฟ๐—ฎ๐—บ๐—ฒ๐˜๐—ฒ๐—ฟ => ๐—˜๐˜…๐—ฝ๐—ฟ๐—ฒ๐˜€๐˜€๐—ถ๐—ผ๐—ป

๐Ÿ‘€Here:

- "square" is the name of the function

- "a" is the parameter of the function

- "a * a" is the function expression Image
Read 7 tweets
Mar 23
๐Ÿ”ฅ Design a hoverable background like this using only 2 lines of code.

๐Ÿ‘€๐Ÿ‘‡
๐Ÿ“Œ This background is "before" pseudo-element.

๐Ÿ“Œ Just you have to scale the background from 0 to 1.
๐Ÿ“Œ Codepen link:

codepen.io/atechajay/pen/โ€ฆ
Read 4 tweets
Mar 23
โ›” How to protect your eyes as a programmer?

โ›” How to protect your eyes as a coder?

โ›” How to keep healthy for your eyes as a web programmer?

A Thread๐Ÿงตโ‡ฉ
โ›” Note:

๐Ÿ“Œ I am not a doctor, just share this guide on the basis of my research and ability.

๐Ÿ“Œ I will share my used tools for caring for my eyes as well as some personal guidance on it.

Let's start...
๐Ÿ“Œ Drink water more and more!

โ†’ As we already know that approx 60% of water is in our bodies.

โ†’ Drinking water will help flush out salt or harmful element in the body and properly hydrate your eyes to help reduce eye strain.
Read 16 tweets
Mar 22
๐Ÿ’› Day 2๏ธโƒฃ1๏ธโƒฃ / 3๏ธโƒฃ0๏ธโƒฃ days of basics in JavaScript series!

โ†’ What is a ternary operator?

โ†’ The conditional ternary operator in JavaScript?

โ†’ The conditional operator in a template literal?

#javascript30
๐Ÿ“Œ What is a ternary operator?

โ†’ Which operator takes 3 operands that are a ternary operator.

๐Ÿ’š In short:

1 operand : Unary operator
2 operand : Binary operator
3 operand : Ternary operator
๐Ÿ“Œ The conditional (ternary) operator in JavaScript?

โ†’ This is similar to the "if" and "else" statements but in a single line.

โ†’ This is an operator, which produces a value.

โ†’ There are 3 parts of this operator.

Have a look!๐Ÿ‘€๐Ÿ‘‡
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(