Posts

Showing posts from November, 2023
Image
      Hello  This is the day 30  of #30 days of javascrip coding, at this day  I studied  Object  Lesson    and   i learned that 1- Object t has properties or data and has specific actions  that it performs with methods. 2-The Window and the Location types are Object, knowing that the Location is considered a Nested Object from the Window, which is also an Object. 3-After that, when I use the href with the Window.Location object, here it expresses the properties, and here I inquired about a property or data, which serves as a link to the site that I opened, it is information! 4- But if you are dealing with a Method that executes a specific Action, then why do we use assign with Window.location 5- Here in Action, it will happen that the site that I opened will change its address to the Google site and the Google site will open instead. Here in Action, it happened and it remains under the scope of the Method, and this is the difference between Properties and Methods. T hat's what I l
Image
    Hello  This is the day 29  of #30 days of javascrip coding, at this day  I studied Scope – Lexical (Static) Lesson    and   i learned that 1- The lexical scope in the function is not equivalent to if you have a nested function, then the child function can access the variables in the parent function, and so every function inside the function can access the variables of the function that is descended from it. 2-If the child function has no variables in the father function, it has access to the variables in the Global Scope 3-In this Child Function, I used the Console to print the variable a, which is present in the Parent Function. The Child function can access anything present in the Parent function. 4-If this variable a exists in the Child Scope, of course, intuitively, you will take the variable a from the Local Scope. 5-Every function inside a function accesses the variable of its parent function, but the opposite does not happen T hat's what I learned today  and this is the
Image
      Hello  This is the day 28  of #30 days of javascrip coding, at this day  I studied  Scope – Global And Local Lesson  and   i learned that 1-  The Scope is the concept of controlling the presence of your variables and access to them, meaning that through the Scope you will be able to control your access to the variable. 2- Because, in one way or another, it is not logical at all that all variables can be delivered from anywhere 3- Through these codes, I was able to access these variables from anywhere easily, because the Scope has Global, so it was easy to access these variables from anywhere, or even using any syntax such as loop and If. I can access them from anywhere and in any form. 4- Even from within the Function, I was able to use the variables a and b or connect them very easily, and all of this is considered the Global Scope through which I can access any variable from anywhere. 5- I created variables in the Local Scope inside the Function itself, and therefore the Consol
Image
      Hello  This is the day 27  of #30 days of javascrip coding, at this day  I studied  Return Nested Function Lesson and   i learned that 1-  A Nested Function is a function that performs a specific function within another function 2- First, I created a basic function called sayMess inside it. I put 2 parameters inside this basic function. I created a variable called message with the value Hello. 3- After that, I created the Nested Function called concatMsg, and inside it I used the Message variable. Its value was Hello. Inside this variable, I used its value, which is Hello, and then I used the 2 Parameters.Those who were in the basic function 4- After that, I called the concatMsg so that I could use it, and after that, I requested that it do a return for the Message variable. 5- After all this, I used the Console and inside it was the name of the original Function and put the 2 Arguments in it. T hat's what I learned today  and this is the codes i have typed
Image
        Hello  This is the day 26  of #30 days of javascrip coding, at this day  I studied  Function Rest Parameters Lesson   i learned that 1-  Suppose that I have an unknown number of Arguments, and every time I add an Argument, I am forced to add a new Parameter, and thus I start entering the Parameter into the calculation process. 2- This may apply, for example, if someone enters a site and wants to post his Skills, the Skill may be one, 10, or an unknown number. 3- Here comes the role of the Rest Parameters. In short, writing it consists of 3 points, then the name of the Parameter, and its purpose is to create an infinite number of Params. 4- I will also notice something that the Parameters Rest is an Array, so I can deal with it and with any Argument that forms a Value for this Para. It is an element of the Array, meaning I can use the Length and use all the properties of the Array. T hat's what I learned today  and this is the codes i have typed
Image
        Hello  This is the day 25  of #30 days of javascrip coding, at this day  I studied  Function Default Parameters Lesson   i learned that 1-  The Default Value, if there is no value for the Parameter, it  will be Undefined 2- If you do not write a value for the age parameter, the result will be Undefined by default 3- However, if the user actually did not enter the Age, it would not make sense for it to be Undefined, and it would be better if an alternative message was printed in its place. This can be done in 3 ways, including the ES6 method. 4- The first way is to make a condition if the default age value is Undefined. This definitely indicates that the user neglected to enter the age value, because Undefined does not appear unless the user neglected to write the age. 5- Here, if the value of age becomes Undefined, meaning the user left it empty, print the place of the variable age. This is an alternative word called Unknown, so I stored it as a variable in the age so that it i
Image
  Hello  This is the day 24  of #30 days of javascrip coding, at this day  I  Function Intro And Basic Usage Lesson and   i learned that 1-  The Function is a code that executes certain things. The purpose of using the Function is that it applies a principle called DRY, which stands for Don’t Repeat Your Self. Meaning, if you have a specific task that you do every once in a while, here I use the Function in order not to repeat it every time. 2- There is a Function that is Built-in in the JavaScript language, meaning a Function is always ready and is used to execute a specific command, such as when you use the Consol.log, which is also considered a Function. Its function is to print commands 3-  There is another type of Function called User-Defined, which is the Function that is created by the user. 4- The Function accepts two things, the first is the Parameter and the second is the Argument 5- The username is the parameter that is entered into the function and is expressed as Variable
Image
        Hello  This is the day 23  of #30 days of javascrip coding, at this day  I studied  Loop – Do, While Lesson  Lesson   i learned that 1-  The Do-While command tells the code that it compulsorily executes something first and then checks the condition. 2- This means that when I used the while or the for code, the code would perform a check at the beginning for the condition, if True, the loop would execute until it became False. 3-  But in the case of Do–While, I let the code execute forcedly first 4- The written code means that by saying Do I do this command first and then I use the while to make it check the condition. 5- First, it will print the value of i, which is 0. After that, increment will be obtained through  i ++. 6-  After that, it goes to the condition that I set to false so that it does not complete the looping. It executes only do. 7- After that, I typed the “i” again to make sure that he typed the “0” for the first time. After that, the increment happened. T hat
Image
      Hello  This is the day 22  of #30 days of javascrip coding, at this day  I studied  Loop – While Lesson   i learned that 1-  The While Loop is similar to the For Loop in general loop performance, but the Syntax is slightly different in its shape, but the result from both is the same. 2- In the loop while, at the beginning the variable defines in the stage called initialization 3-  The while next to it is the condition, which as long as it is True , the loop remains running 4-  After that, printing is done, and then the increment process is completed, which is called Final Expression. Without its presence, the loop will remain running forever because it is responsible for increasing the value of the index until it reaches a stage where the condition is False and its fulfillment stops. 5- It is possible, if i would like, to break it as soon as the loop reaches a number. T hat's what I learned today  and this is the codes i have typed
Image
  Hello  This is the day 21  of #30 days of javascrip coding, at this day  I studied  Loop – For and The Concept Of Loop Lesson   i learned that 1-   The Loop is used to save time, meaning instead of writing with your hand, for example, the numbers from 0 to 9. Every time you will need to write a code and repeat it ten times in a row, each time changing the number. 2- n the case of the for-loop, you write a single line that can print from 0 to 9. We will know how this happens. The first thing we will see is the syntax of the for-loop in the following lines. 3-  First, I do something called initialize, which will start the code from there. In the case of our example, the starting point will be from 0. 4- Secondly, I write a condition whose purpose is to be fulfilled. Have you reached number 9 or not yet? If you continue repeating until you reach the fulfillment of the condition and then stop, the condition will be fulfilled. 5- The third stage is in which I confirm that the increase has
Image
      Hello  This is the day 20  of #30 days of javascrip coding, at this day  I studied  Searching Array   Lesson   i learned that 1-  The first thing I need to do is indexOf without specifying where the search will start. The result will be that it will find the element. It becomes the first name and its indexing is 0. 2- Using the indexOf with a selection, we will start the search from index 2. The result will be that the element has the last name and its indexing is 4. 3-  For LastIndexOf, it is used to search from the last to the first. This means that it will start the search from the end of the array and find the element at the end. Then, the normal count of the index will start from the beginning until it reaches the last index, which will be numbered 4. 4-  I use includes to ask whether this array contains the element? If, oh, it remains True, even if it does not, then it remains False 5- We can use If Condition here to test whether the element exists or not. If it exists, pri
Image
    Hello  This is the day 19  of #30 days of javascrip coding, at this day  I studied  Add And Remove From Array Lesson   i learned that 1-  The unshift is used to add items to the array at the beginning, meaning the names will be added at the beginning of the array 2- Push is used to add items to the array at the end. This means that the names will be added at the end of the array. 3-  The shift is used to remove the first item from the array, meaning the first name will be removed from the array. 4-  You can store the item that was deleted in a variable, call that variable, and print the value in it, which is the deleted item. 5- The pop is used to remove the last item from the array. This means that the last name in the array will be removed. I can store the name that was created in a variable and call it.   T hat's what I learned today  and this is the codes i have typed
Image
    Hello  This is the day 18  of #30 days of javascrip coding, at this day  I studied  Array Big Introduction   and  i learned that 1-  The array  is created by using brackets square [ ] and contains data inside it that is separated by the Comma sign. 2- If I want to access a specific element inside the Array, this is done by indexing the element in the sequence. 3-  It is possible to access a specific letter within a word or a number within an array 4-  It is possible to replace a word with another word within the array without changing the array and without an error message appearing. 5- It is also possible to modify the nested loop with other names and change the content of the array T hat's what I learned today  and this is the codes i have typed  
Image
  Hello  This is the day 17  of #30 days of javascrip coding, at this day  I studied  Switch Statement   and  i learned that 1-  Very simply, I can use the Switch Statement. I can use it to make Control Flow like If && Else If. 2- The difference between them is that the If Condition is closer to using it than the Boolean Values, meaning the result of the code is waiting for True to fulfill the condition or False to fulfill another condition. 3-  However, it is preferable to use the Switch Statement if you have a lot of cases or very many cases, such as if you use Control Flow in which the days of the entire month are in, the name of each day, and so on. T hat's what I learned today and this is the codes i have typed
Image
  Hello  This is the day 16  of #30 days of javascrip coding, at this day  I studied  Nullish Coalescing Operator And Logical Or   and  i learned that 1-  Very simply put, the purpose of this lesson is to present data that will be an alternative to your data. If the original data is damaged or has a problem, there will be a replacement for it that will appear in its place, especially if this data is, for example, the price of a product. 2- If for some reason there is a problem with the variable of price, it becomes 0 and null here comes || Or which sends an alternative value, so you will find the 200 shown as a direct replacement in case a problem occurs 3-  This alternative data is returned if the value of the variable is 0, null, undefined, or any Falsy value, and you can query these False values through the Constructor called Boolean. 4-  The Nullish Coalescing has nothing to do with the Falsy value, unless the value is null or undefined. In this case, you will only be given an alte
Image
    Hello  This is the day 15  of #30 days of javascrip coding, at this day  I studied Nested If Condition  and  i learned that 1- Very simply, it means that you put a condition inside another condition. For example, if I have 3 conditions with 3 different scenarios, which are as follows: 2-The first scenario is that you ask whether there is a Discount in general or not 3-  The second scenario asks: Is this keyboard Egyptian?! If yes, we will create a special case here. We will assign him a separate case and give him a discount, for example, a 10-pound discount. In this special case, I will also create an exceptional case, if he is really Egyptian. I will also ask if he is a student?! If he is a student, then the discount will be larger and it will be 30 pounds, which is the nested condition, but if he is Egyptian and not a student here, I will make the regular discount of 10 pounds. 4- The third scenario is that there is no discount at all and the person is not Egyptian Therefore, the