Ajay Yadav Profile picture
Mar 25, 2022 โ€ข 9 tweets โ€ข 3 min read โ€ข Read on X
๐Ÿ’› 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

Sep 7
Unlocking the Secrets of Big-O Notation.

Let's see the ultimate guide: ๐Ÿงต Image
โœ… Overview of Big-O

Big-O notation is a way to describe the time-complexity of an algorithm, representing the "upper bound" of its running time in terms of the "input" size.

It provides a high-level understanding of how the algorithm's performance scales with the size of the input.

In Big-O notation, the letter "O" stands for order of magnitude. The notation is written as O(f(n)), where f(n) is a mathematical function that describes the upper bound on the running time or space complexity in relation to the input size (n).
โœ… Common Big-O Notations:

1. O(1) - Constant Time Complexity: Represents algorithms whose running time is constant, regardless of the input size. For example: Accessing an element in an array by index, basic arithmetic operations.

2. O(log n) - Logarithmic Time Complexity: Common in algorithms that divide the problem into smaller subproblems. For example: Binary search, and certain divide-and-conquer algorithms.

3. O(n) - Linear Time Complexity: The running time grows linearly with the size of the input. For example: Iterating through an array, finding the maximum element in an array.

4. O(n log n) - Linearithmic Time Complexity: Common in efficient sorting algorithms. For example: Merge sort, heap sort, etc.

5. O(n^2), O(n^3), ... Polynomial Time Complexity: The running time is a polynomial function of the input size. For example: Simple nested loops, and some sorting algorithms with poor performance.

6. O(2^n), O(n!) - Exponential and Factorial Time Complexity: Usually indicates inefficient algorithms with rapidly growing running times. For example: Recursive solutions with high redundancy.Image
Read 8 tweets
Aug 30
Browsers are the new operating systems, with 137,345 apps at your fingertips!

Here are the top 8 browser apps you won't want to miss. Image
1. Thunderbit - It offers AI-powered templates for effortless automation.

With one click, you can:
- Extract data
- Sync emails
- Generate replies
- Create social media captions, and much more.

๐Ÿ‘‰ thunderbit.comImage
2. BiRead: It's an extension that helps you overcome language barriers.

- Reading papers
- Scrolling social media
- Reading books
- Searching for travel tips
- Reading emails
- Learning a language

๐Ÿ‘‰ biread.com/?via=ajay
Read 9 tweets
Aug 14
The internet is a FREE library for books.

Top 7 websites to read or download books for FREE.

[Save these] Image
1. Google Books

Google Books offers millions of searchable books and magazines.

Browse, preview, and read full texts. Discover new titles, build your own library, and access your books across devices.

A treasure trove for readers and researchers. Image
2. PDF Drive

The world's largest free PDF book database. Browse millions of titles across genres without signup.

New books added regularly. Download and read instantly on any device. A book lover's paradise. Image
Read 8 tweets
Aug 1
You're in an interview and the interviewer asks:

"Explain the core principles of responsive web design?"

Here is how you can answer:๐Ÿงต
Responsive web design is built on 4 core principles:

1. Fluid layout
2. Responsive units
3. Flexible images
4. Media queries

Let's see one-by-one...
1. Fluid layout

Ensures web pages adapt to the viewport width and height, providing a seamless user experience on different devices.

Instead of using fixed units like pixels (px), use relative units like percentages (%), viewport height (vh), and viewport width (vw). These units adjust elements based on the current viewport size.

Utilize the property like, max-width instead of width to allow elements to resize but not exceed a specified maximum width, ensuring they fit within their container.
Read 7 tweets
Jun 20
10 Incredible AI Tools You Won't Believe Exist in 2024!

[Bookmark for later use ๐Ÿ”–] Image
1. Momen: Build Web Apps with No-Code

Momen simplifies AI app creation with user-friendly tools, easy data integration, seamless workflow integration, and customizable frontend design using a component library and infinite canvas.

go.momen.app/QJfvkTDb
2. Microsoft Loop

An online collaboration platform by Microsoft, seamlessly integrating teams, content, and tasks across apps and devices.

loop.microsoft.com
Read 12 tweets
Jun 19
Google Chrome offers 130,445 extensions, but only a few extraordinary.

These 7 will save you hours.

[Bookmark for later use ๐Ÿ”–] Image
1. Pop AI

Student's best friend for an easy life, enabling them to chat with PDF, create presentation , generate organizational charts,write,academic essays and craft killer CVs all in one platform.
2.Compose AI

Compose ai is a chrome extension that cuts your writing time in 40./. with ai powered autocompletion and text generation.
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!

:(