0% found this document useful (0 votes)
14 views7 pages

21x51a0544 CRUD, Operators, Data-Types

Curd operations

Uploaded by

sameersyed0111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views7 pages

21x51a0544 CRUD, Operators, Data-Types

Curd operations

Uploaded by

sameersyed0111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

ASSIGNMENT-1

Other data types assignments


Null: Represents the absence of any object value.
Ex: let empty = null;
Undefined: Represents an uninitialized variable.
Ex: let uninitialized;
Object: Represents a collection of key-value pairs.
Ex: let person = {name: 'John', age: 30};
Array: Represents an ordered collection of values.
Ex: let colors = ['red', 'green', 'blue'];
Symbol: Represents a unique identifier.
Ex: let sym = Symbol('foo');
BigInt: Represents large integers.
Ex: let bigInt = 12345678901234567890n;
NaN (Not a Number): Represents an invalid or unreliable numeric
result.
Infinity: Represents positive or negative infinity
Function: Represents a block of code that can be executed.
Ex: `let greet = function(name){console.log(Hello, ${name}!); };`
Date: Represents a date and time value.
Ex: let date = new Date('2022-01-01');
RegExp (Regular Expression): Represents a pattern for matching
strings.
Ex: let pattern = /hello/gi;
Map: Represents a collection of key-value pairs, similar to an object,
but with some differences.
Ex: let map = new Map([['key1', 'value1'], ['key2', 'value2']]);
Set: Represents a collection of unique values.
Ex: let set = new Set([1, 2, 3, 3, 4]);
WeakMap: Represents a collection of key-value pairs, similar to a
Map, but with weak references.
Ex: let weakMap = new WeakMap([[{key: 'key1'}, 'value1']]);
WeakSet: Represents a collection of weakly referenced objects.
Ex: let weakSet = new WeakSet([{value: 'value1'}]);
Promise: Represents a value that may not be available yet, but will
be resolved at some point in the future.
Ex: let promise = new Promise ((resolve, reject) => {setTimeout(() =>
resolve('value'), 1000); });
AsyncFunction: Represents an asynchronous function.
Ex: let asyncFunc = async function () {return 'value';};

ASSIGNMENT-2
create, read, update, delete
create, read”
<script>
let college={
name:"srec",
address:"ndl",
rating:5
};
console.log(college);
console.log(college.name);
</script>
Update:
<script>
let college={
name:"srec",
name:"rgm",
address:"ndl",
rating:5
};
console.log(college);
console.log(college.name);
</script>
Delete:
<script>
let college={
name:"srec",
name:"rgm",
address:"ndl",
rating:5
};
delete college.address
console.log(college);
console.log(college.name);
</script>
Assignment-3
Operators in js
1) Assignment operators: =
2) Arithmetic operators: + - * / %
3) Short hand math: +=, /==, *=, -=
4) Conditional operators: <, >, <=, >=, ! ==
5) Unary operators: ++, --
6) Logical: &&, ||, ^ (ex-or operator)
7) Ternary operators: ?:
8) Equity opeartors: ==, ===

1) Assignment Operators
= (Assignment)
+= (Addition assignment)
-= (Subtraction assignment)
*= (Multiplication assignment)
/= (Division assignment)
%= (Modulus assignment)
**= (Exponentiation assignment)
2) Arithmetic Operators
+ (Addition)
- (Subtraction)
* (Multiplication)
/ (Division)
% (Modulus)
** (Exponentiation)
3) Short hand math
Addition
x += y is equivalent to x = x + y
Subtraction
x -= y is equivalent to x = x - y
Multiplication
x *= y is equivalent to x = x * y
Division
x /= y is equivalent to x = x / y
Modulus
x %= y is equivalent to x = x % y
Exponentiation
x **= y is equivalent to x = x ** y
let x = 5;
x += 3;-----equivalent to x = x + 3
console.log(x); output: 8
4)Conditional operators
== (Equal to)
!= (Not equal to)
> (Greater than)
< (Less than)
>= (Greater than or equal to)
<= (Less than or equal to)
5) Unary operators
+ (Unary plus)
- (Unary negation)
! (Logical NOT)
~ (Bitwise
NOT) typeof
(Typeof) void
(Void)
6) Logical Operators
&& (And)
|| (Or)
! (Not)
7) Ternary Operator
?: (Conditional)
condition ? expressionIfTrue : expressionIfFalse;
condition: A boolean expression that evaluates to true or false.
expressionIfTrue: The value to return if the condition is true.
expressionIfFalse: The value to return if the condition is false.
Example:
let age = 25;
let status = age >= 18 ? 'adult' : 'minor';
In this example:
age >= 18 is the condition.
'adult' is the expression to return if the condition is true.
'minor' is the expression to return if the condition is false.
8) Equity operators
In JavaScript, equality operators are used to compare values and
determine if they are equal or not. Here are the equality operators
in JavaScript:
=== (Strict Equality)
Checks if the values and data types are equal.
Example: 5 === 5 returns true, 5 === '5' returns false
!== (Strict Inequality)
Checks if the values or data types are not equal.
Example: 5 !== 5 returns false, 5 !== '5' returns true
== (Loose Equality)
Checks if the values are equal, but ignores data type differences.
Example: 5 == 5 returns true, 5 == '5' returns true
!= (Loose Inequality)
Checks if the values are not equal, ignoring data type differences.
Example: 5 != 5 returns false, 5 != '5' returns false

You might also like