🆖 Karan Oza Profile picture
Oct 1, 2020 27 tweets 5 min read Read on X
🧵Top JavaScript Interview Questions🧵

⚡️Questions and Answers :

#100DaysOfCode #CodeNewbie #javascript
Q1 . What is JavaScript?

JavaScript is a text-based programming language used both on the client-side and server-side that allows you to make web pages interactive. The general-purpose core of the language has been embedded in Netscape and other web browsers.
Q2. Is JavaScript a case-sensitive language?

Yes, JavaScript is a case sensitive language. The language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.
Q3. How can you create an object in JavaScript?

JavaScript supports Object concept very well. You can create an object using the object literal as follows −

var emp = {
name: "Daniel",
age: 23
};
Q4. How can you create an Array in JavaScript?

var x = [];
var y = [1, 2, 3, 4, 5];
Q5. Can you assign an anonymous function to a variable and pass it as an argument to another function?

Yes! An anonymous function can be assigned to a variable. It can also be passed as an argument to another function.
Q6. What is argument objects in JavaScript & how to get the type of arguments passed to a function?
JavaScript variable arguments represents the arguments that are passed to a function. Using typeof operator, we can get the type of arguments passed to a function. For example −
Q7. What are the scopes of a variable in JavaScript?

The scope of a variable is the region of your program in which it is defined. JavaScript variable will have only two scopes. (1/2)
• Global Variables − A global variable has global scope which means it is visible everywhere in your JavaScript code.

• Local Variables − A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.(2/2)
Q8. What is the purpose of ‘This’ operator in JavaScript?

The JavaScript this keyword refers to the object it belongs to. This has different values depending on where it is used. In a method, this refers to the owner object and in a function, this refers to the global object.
Q9. What is Callback?

A callback is a plain JavaScript function passed to some method as an argument or option. It is a function that is to be executed after another function has finished executing, hence the name ‘call back‘.
Q10. What is Closure? Give an example.

- Closures are created whenever a variable that is defined outside the current scope is accessed from within some inner scope. It gives you access to an outer function’s scope from an inner function. (1/2)
- In JavaScript, closures are created every time a function is created. To use a closure, simply define a function inside another function and expose it.(2/2)
Q11. Name some of the built-in methods and the values returned by them.

CharAt()
Concat()
forEach()
indexOf()
length()
pop()
push()
reverse()
Q12. How does TypeOf work?
The typeof operator is used to get the data type of its operand. The operand can be either a literal or data structure such as a variable, a function, or an object. It is a unary operator i.e. placed before its single operand, which can be of any type.
Q13. How to create a cookie using JavaScript?

The simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this-

Syntax :

document.cookie = "key1 = value1; key2 = value2; expires = date";
Q14. What is the difference between Attributes and Property?

Attributes- provide more details on an element like id, type, value etc.

Property- is the value assigned to the property like type=”text”, value=’Name’ etc.
Q15. What is a Typed language?

Typed Language is in which the values are associated with values and not with variables. It is of two types:

Dynamically: in this, the variable can hold multiple types; like in JS a variable can take number, chars.(1/2)
Statically: in this, the variable can hold only one type, like in Java a variable declared of string can take only set of characters and nothing else.(2/2)
Q16. What is the difference between Local storage & Session storage?

Local Storage – The data is not sent back to the server for every HTTP request – reducing the amount of traffic between client and server. It will stay until it is manually cleared through settings or program.
Session Storage – It is similar to local storage; the only difference is while data stored in local storage has no expiration time, data stored in session storage gets cleared when the page session ends. Session Storage will leave when the browser is closed.
Q17. What is the difference between the operators ‘==‘ & ‘===‘?

The main difference between “==” and “===” operator is that formerly compares variable by making type correction :
e.g. if you compare a number with a string with numeric literal, == allows that, but === doesn’t allow that, because it not only checks the value but also type of two variable, if two variables are not of the same type “===” return false, while “==” return true.
Q18. What is the difference between null & undefined?

Undefined means a variable has been declared but has not yet been assigned a value. On the other hand, null is an assignment value. It can be assigned to a variable as a representation of no value.
Q19. What would be the result of 2+5+”3″?

Since 2 and 5 are integers, they will be added numerically. And since 3 is a string, its concatenation will be done. So the result would be 73. The ” ” makes all the difference here and represents 3 as a string and not a number.
Q20. What is the ‘Strict’ mode in JavaScript and how can it be enable

Strict mode is a way to introduce better error-checking into your code.
- When you use strict mode, you cannot use implicitly declared variables, or assign a value to a read-only property, or add a property to an object that is not extensible.

- You can enable strict mode by adding “use strict” at the beginning of a file, a program, or a function.

• • •

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

Keep Current with 🆖 Karan Oza

🆖 Karan Oza 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 @OzaKaran

Oct 10, 2020
🧵How To Find A Job 🧵

✅5 Important Steps & Guideline

#100DaysOfCode #CodeNewbie
1. Online Job Searching Platforms

1. Indeed: Best Overall
2. AngelList: Best for Startup Jobs
3. LinkedIn: Best for Connecting Directly With Recruiters
4. LinkUp: Best for Up-to-Date Listings
5. Scouted: Best for Recent College Graduates
6. Snagajob: Best for Hourly Jobs
7. Monster: Runner-Up, Best Overall
8. Glassdoor: Best for Employer Insights
9. FlexJobs: for Remote Jobs
10. The Ladders: Best for Experienced Managers
11. Google for Jobs : job search feature, making it possible for job seekers to search for positions straight through Google
Read 15 tweets
Sep 29, 2020
🔗Chain of Motivation and Appreciation

🌈 You all are doing amazing work.
Claps for your motivation & support 👏👏👏

📝 Mention your friends, mentor or accounts from whom you inspired & want to appreciate them 👏🤗🙏

#100DaysOfCode #CodeNewbie
@sandhya_subram
@RitikaAgrawal08
@pritkalariya
@SeemaSaharan5
@styleDevNerd
@Deepak_python
@TracyCss
@HTMLmom

Thanks for always inspiring this Dev Community 🙏👏 keep doing amazing.
Read 5 tweets
Sep 29, 2020
🧵JavaScript Frameworks to Learn🧵

⭐️Front-End, Back-End & Testing

#100DaysOfCode #CodeNewbie #javascript
According to stackoverflow’s survey 2020, JavaScript is the most commonly used language for the 8th year straight with 67.7% people opting for it. The major reason for its popularity is the fact that its versatile & can be used for both frontend & backend as well as for testing.
Front End JavaScript framework

1. React JS
2. Angular
3. Vue Js
4. Ember JS
5. Preact JS
6. Svelte JS
7. Jquery
8. Backbone JS
Read 5 tweets
Sep 28, 2020
🧵Web Development Project Ideas For CodeNewBies🧵

1. One-page layout
2. Login authentication
3. Product landing page
4. Giphy with a unique API
5. JavaScript Quiz game
6. To-do list
7. SEO-friendly website

#100DaysOfCode #CodeNewbie
8. JavaScript drawing
9. Reminder app
10. Google home page Clone
11. Tribute page
12. Survey form
13. Exit plugin
14. Weather app
15. Social share buttons
16. Toast notifications
17. AJAX-style login
18. Word counter
19. Countdown timer
20. Modal pop-ups
21. Address book
22. The Movies Dashboard
23. Tic Tac Toe Game
24. E- commerce Site
25. Color picker jumbtron
Read 4 tweets
Sep 24, 2020
🧵Asynchronous JavaScript & Callback🧵

⚡️Informative thread with examples

#100DaysOfCode #CodeNewbie #javascript
Synchronous :

- Synchronous operations in JavaScript entails having each step of an operation waits for the previous step to execute completely.

- This means no matter how long a previous process takes, subsequent process won't kick off until the former is completed. Image
Asynchronous :

- Asynchronous operations, on the other hand, defers operations.

- Any process that takes a lot of time to process is usually run alongside other synchronous operation and completes in the future. Image
Read 9 tweets
Sep 20, 2020
🧵Promises In JavaScript🧵

✅Informative Thread with an Examples

#100DaysOfCode #CodeNewbie #javascript
" I promise to do this whenever that is true. If it isn't true, then I won't."

This is a simple illustration of JavaScript Promises. Sounds like an IF statement? We’ll soon see a huge difference.
- A promise is used to handle the asynchronous result of an operation.

- JavaScript is designed to not wait for an asynchrnous block of code to completely execute before other synchronous parts of the code can run.
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!

:(