Term
|
Definition
noun: epistemology
-
the theory of knowledge, especially with regard to its methods, validity, and scope, and the distinction between justified belief and opinion.
|
|
|
Term
What is the primitive type? |
|
Definition
primitive type datatype are as follows
- number
- String
- Boolean
- Null
- Undefined
- Symbol
- BigInt
do not confuse yourself with primitive values example
typeof 42 , returns "Number" but typeof new Number(32) returns Object |
|
|
Term
|
Definition
The typeof operator is unary { which means it only take one argument} and inform us of the type of data indicated as a given argument.
the argument can be either a literal or a variable.
All possible return values of the typeof operator are:
"undefined" "object" "boolean" "number" "bigint" "string" "symbol" "function" |
|
|
Term
string interpolation what is it |
|
Definition
. String interpolation is a process of substituting values of variables into placeholders in a string1
// C# example
string name = "Alice";
int age = 25;
Console.WriteLine($"Hello, {name}. You are {age} years old.");
// Output: Hello, Alice. You are 25 years old.
in javascript
let str = "text";
let strStr = String(str);
console.log(`${typeof str} : ${str}`);
console.log(`${typeof strStr} : ${strStr}`);
|
|
|
Term
|
Definition
In JavaScript, literals represent fixed values that you provide directly in your code. These values are not variables; they are constants that you literally write into your script.
example of Object literals
const person = {
name: "Alice",
age: 30,
isStudent: false
};
|
|
|
Term
What is type conversions ? |
|
Definition
Type conversion in JavaScript refers to changing the data type of a value from one type to another.
here good example :
let y = "5"; // y is a string
let x = +y; // x is a number -- > you will get a NaN
String(x); // returns a string from a number variable x
String(123); // returns a string from a number literal 123
String(100 + 23); // returns a string from an expression
correct will be Number(y) will return numeric value.
|
|
|