javascript js Flashcards

(40 cards)

1
Q

if you made an id is name is hello and you did like this

hello.innerHTML = “Hello”;
will you get Hello in the page?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

console.log(2 ** 4);

A

16

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

console.log(11 %5)

A

1 باقي القسمه

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

console.log(Number(“100”));

A

100 بتحول اي حاجه لرقم

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

console.log(100..toString());

A

بيحول اي حاجه لstring
100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

console.log(100.5555.toFixed(2));

A

بيقرب مرتبتين
100.56

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

console.log(parseFloat(“100.500”));

A

بيجول ال string ل float

100.5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

console.log(parseInt(“100.500”));

A

بيحول ال string ل int
100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

console.log(Math.round(99.2));

A

بيقرب

99

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

console.log(Math.floor(99.9));

A

بينزل الرقم

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

console.log(Math.ceil(99.1));

A

بيقرب لاقصى حاجه

100

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

console.log(Math.min(10,25,-11));

A

بيدور على الاقدم

-11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

console.log(Math.max(25,10,-11));

A

بيدور على الاكبر

25

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

console.log(Math.pow(2,4));

A

اثنين اس اربعه
16

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

console.log(Math.trunc(99.5));

A

بيشيل الكسور

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

let Name = Ahmed;
console.log(Name[1])

A

h

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

let Name = Ahmed;
console.log(Name.charAt(1))

17
Q

let Name = Ahmed;
console.log(Name.length());

18
Q

let Name = Ahmed;
console.log(Name.toUpperCase());

19
Q

let Name = Ahmed;
console.log(Name.toLowerCase());

20
Q

let Name = Ahmed;
console.log(Name.trim());

A

بيشيل ال space

21
Q

let a = “Elzero web school”;
console.log(a.indexof(“web”));

A

بيدور على اول حاجه w

7

22
Q

let a = “Elzero web school”;
console.log(a.lastIndexof(“web”))

23
Q

let a = “Elzero web school”;
console.log(a.slice(2,6))

A

بيحسب من 2 و بيقطع من قبل الاخير

zero

24
-let a = "Elzero web school"; console.log(a.split("")) let a = "Elzero web school"; console.log(a.split(" ",2))
هيجبلك كل الحروف- -عنصرين بس و هيقطع كل ال spze Elzero ,web
25
let a = "Elzero web school"; console.log(a.subString(2,6))
نفس ال slice zero
26
let a = "Elzero web school"; console.log(a.subString(-10,6))
بيبدا من الصفر لو سالب Elzero
27
let a = "Elzero web school"; console.log(a.subStr(0,6))
0 البدايه 6 عدد العناصر Elzero
28
let a = "Elzero web school"; console.log(a.slice(2,6))
29
let a = "Elzero web school"; console.log(a.includes("web"))
true
30
let a = "Elzero web school"; console.log(a.includes("web",8))
في 8 هل في web كامله false
31
Boolean("")
false
32
let myfriends = ["mohammed" ,"bruh","bigger",["whatdog","nah"]] console.log(`${myfriends[3][1][2]}`);
بيدور على ال array و بعد كدهبيدور على اللي جواه و بعد كده بيدور على اللى جواه a
33
let myfriends = ["mohammed" ,"bruh","bigger","whatdog","nah"] myfriends[myfriends.length] = "niggates"; console.log(`${myfriends}`);
it adds alot anther one to it "mohammed" ,"bruh","bigger","whatdog","nah",niggates
34
let myfriends = ["mohammed" ,"bruh","bigger","whatdog","nah"] myfriends[myfriends.length -1] = "niggates"; console.log(`${myfriends}`);
it will take the last one mohammed" ,"bruh","bigger","whatdog",niggates
35
/* Arrays Methods [Adding And Removing] - unshift("", "") Add Element To The First - push("", "") Add Element To The End - shift() Remove First Element From Array - pop() Remove Last Element From Array */ let myFriends = ["Ahmed", "Mohamed", "Sayed", "Alaa"]; console.log(myFriends); myFriends.unshift("Osama", "Nabil"); console.log(myFriends); myFriends.push("Samah", "Eman"); console.log(myFriends); let first = myFriends.shift(); console.log(myFriends); console.log(`First Name Is ${first}`); let last = myFriends.pop(); console.log(myFriends); console.log(`Last Name Is ${last}`);
/* Arrays Methods [Adding And Removing] - unshift("", "") Add Element To The First - push("", "") Add Element To The End - shift() Remove First Element From Array - pop() Remove Last Element From Array */
36
console.log(myfriends.sort());
بيرتب من الاضغر للاكبر
37
console.log(myfriends.reverse());
بيعكس
38
break
بيقطع
39
continue
بيشيل و بيكمل