javascript js Flashcards

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))

A

h

17
Q

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

A

5

18
Q

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

A

AHMAD

19
Q

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

A

ahmad

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”))

A

7

23
Q

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

A

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

zero

24
Q

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

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

A

هيجبلك كل الحروف-

-عنصرين بس و هيقطع كل ال spze

Elzero ,web

25
Q

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

A

نفس ال slice

zero

26
Q

let a = “Elzero web school”;
console.log(a.subString(-10,6))

A

بيبدا من الصفر لو سالب

Elzero

27
Q

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

A

0 البدايه
6 عدد العناصر

Elzero

28
Q

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

A
29
Q

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

A

true

30
Q

let a = “Elzero web school”;
console.log(a.includes(“web”,8))

A

في 8 هل في web كامله

false

31
Q

Boolean(“”)

A

false

32
Q

let myfriends = [“mohammed” ,”bruh”,”bigger”,[“whatdog”,”nah”]]

console.log(${myfriends[3][1][2]});

A

بيدور على ال array و بعد كدهبيدور على اللي جواه و بعد كده بيدور على اللى جواه

a

33
Q

let myfriends = [“mohammed” ,”bruh”,”bigger”,”whatdog”,”nah”]

myfriends[myfriends.length] = “niggates”;

console.log(${myfriends});

A

it adds alot anther one to it

“mohammed” ,”bruh”,”bigger”,”whatdog”,”nah”,niggates

34
Q

let myfriends = [“mohammed” ,”bruh”,”bigger”,”whatdog”,”nah”]

myfriends[myfriends.length -1] = “niggates”;

console.log(${myfriends});

A

it will take the last one

mohammed” ,”bruh”,”bigger”,”whatdog”,niggates

35
Q

/*
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});

A

/*
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
Q

console.log(myfriends.sort());

A

بيرتب من الاضغر للاكبر

37
Q

console.log(myfriends.reverse());

A

بيعكس

38
Q

break

A

بيقطع

39
Q

continue

A

بيشيل و بيكمل