Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

work whit data type #12

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

work whit data type #12

wants to merge 3 commits into from

Conversation

raminLgh
Copy link
Contributor

closes : #7

@raminLgh raminLgh requested a review from minasdq March 17, 2024 07:18
@@ -0,0 +1,148 @@
//number

let num1 = 10;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should always use const unless you really need to reassign.
https://stackoverflow.com/questions/41086633/in-javascript-why-should-i-usually-prefer-const-to-let

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay sure


//// M A P

let m1 = new Map();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use better name

Suggested change
let m1 = new Map();
const map = new Map();

let s1 = "salam 1";
let s2 = 'salam 2';
let s3 = `salam 3 ${5}`;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[High]: We have other types of typing in JavaScript as well.

  • bigint
  • undefined
  • boolean
  • function
  • symbol

Copy link

@minasdq minasdq Mar 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, check this:
typeof null
typeof 2 + "2"
typeof 2 - "2"
typeof 2 * "2"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we have.
but you write string and number i think you want this two type.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add theme

return res;
}

function diffrent(s1,s2){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!
There is diffrence function built in. Please write this too


}

function intersection(s1,s2){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for intersection

wm.has(obj);
wm.delete(obj);

/// S E T
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, check this:

  • isSubsetOf
  • isSupersetOf

// WEAK SET
///that's like ordinary set but there is some diffrent
// 1 - elements must ba an obj
// 2 - cant't iterate from a weak set
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 2 - cant't iterate from a weak set
// 2 - cant't iterate from a weak set
// 3- WeakSet does not have size property
//4- WeakSet does not have clear, keys, values, entries, forEach methods.

//is exist ?
console.log(m1.has("ahmad"));

//tree method to iterate
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, there is forEach

@minasdq minasdq requested a review from mkermani144 March 18, 2024 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data type
2 participants