Quiz-App

Question:

What is the difference between method and property?

Answer:

Properties are basically information that an object has. Methods are what an object can do. Example: You have an instance (object) from a class named Vehicle, which can represent a car, a truck or a motorbike.

Question:

What is a variable?

Answer:

Variable means anything that can vary. JavaScript includes variables which hold the data value and it can be changed anytime. JavaScript uses reserved keyword var to declare a variable. A variable must have a unique name.

Question:

What should you keep in mind when naming your variables?

Answer:

A variable name should have a clean, obvious meaning, describing the data that it stores. The name must contain only letters, digits, or the symbols “$” and underscore “_”. And the first character must not be a digit.

Some names cannot be used as variables because they are used by the language itself.

Bookmarks

Question:

What is a data type?

Answer:

A value in JavaScript is always of a certain type. There are 8 different data types for example string or number.

Question:

How does JavaScript recognize the string type?

Answer:

In JavaScript, there are 3 types of quotes.

  • Double quotes: "Hello".
  • Single quotes: 'Hello'.
  • Backticks: `Hello`.

Question:

What’s the difference between ‘==’ and ‘===’?

Answer:

  • = is an assignment operator
  • == is an equality test (loose comparison / looseEquals)
  • === checks the equality without type conversion (strict comparison / strictEquals).

Question:

When comparing string via ‘>’, how does JS determine if this is true?

Answer:

Greater/less than: a > b, a < b.

All comparison operators return a boolean value. true – means “yes”, “correct” or “the truth”. false – means “no”, “wrong” or “not the truth”.

Create

Profile

User's profile photo

User Name

About me:

Hi! I am a web designer/developer focused on crafting great web experiences. Designing and Coding have been my passion since the days I started working with computers.

Skills