Hello everyone, I hope you are fine. In today's tutorial, we are gonna take a look at “ Mathematical operators in JavaScript” in detail. Performing math operator in different programing language is very common. JavaScript also allows several operators to help us in numbers. The mathematical operator in JavaScript is used for performing certain different tasks such as the final price of a financial transaction, browser windows size and calculating the range between the element in a website document. There are two types of operator that I am going to discuss in this tutorial. To perform an action between two variable or values we use mathematical operators. In the equation 3+2 = 5 ( + is a syntax). Java script has many different operators some are basic math operator and others are additionals operators particular to programming. A table of JavaScript Operators Let me explain to you all of these operators in detail. Addition and subtractions are the operators from basic maths. They are used to find the sum and difference of two numerical values. JavsScript has its own built-in calculator. All these mathematical operators can be directly performed in the console. As you have seen a simple example of addition and now I am going to explain it with detail. Now I will assign numerical values to a and b and place the sum in c. Output In a similar way, subtraction(-) also work with the same formula but will subtract the number. Output We can also do add and subtraction by the float ...
Hello friends, I hope you all are feeling great today. In today’s tutorial, we will have a look at a detailed “ While Loop In JavaScript ” topic. It’s our 8th tutorial in JavaScript Series. Loops are used in programming and they offer the easiest and quickest way to do a repetitive task. In this article, we will learn about While and do..while statements as they are the most basic type of Loops. For example, if we want to display the same line “I am learning JavsScript” 10 times. Then this can be done with the help of loops easily rather than typing long code. It will save your time and energy. In JavaScript, while loops loop through a block of code until the specified condition is true. The condition is evaluated before executing the statement. The syntax of the while loop is very similar to i f statement. Syntax while (condition) { // execute this code as long as the condition is true } In the following example, we have to take a variable i = 1, and the while condition is that when it executes it should be less than 5. For each iteration of the loop, we will add one number. Output When we will run the above example, we will receive the following result. You might have already the idea what Infinite loop is because of its name. An infinite loop is a loop that will keep running forever. If you make an infinite loop by accident it can crash your browser. So it is really important the awareness of infinite loop otherwise can crash your computer or browser. Look at the example ...
Hello folks, I hope you are doing great in your life. In today’s tutorial, I am going to talk about “ For Loop In JavaScript”. This is our 7th tutorial of the JavaScript series. Loops are designed in JavaScript to automate the repetition task. You may have encountered a lot of time in programming that you have to repeat an action again and again. To help you in reducing the number of lines code and time, loops were created. There are five types of loops JavaScript have: For Loop will run the same code of block again and again repeatedly, for a specific number of time or as long as a certain condition is met. The For loop of JavaScript is similar to C language and Java for Loop. Syntax for (initialization; condition; final expression) { // code to be executed } The for loop is the most concise part of looping. There is three expression use in for Loop initialization, condition, and final expression. Let me show you a simple example of for loop. As you can see in the image that firstly, we initialize the for loop with let i = 0;. Its means that the loop begins with 0. Afterwards, we declared the condition to be i < 4; means that the loop will continue to run as long as i is less than 3. Our last expression is i++, it will increase by 1 each time the loops runs. Output All of these three expressions in for loop are optional. we can write the for statements without initializations. Look at the demonstration for more clarity. // declare variables outside the loop var i = 5; for (; ...
Hello friends, I hope you all are doing great. In today’s tutorial, we will have a look at the detailed “ Switch Statement in JavaScript ”. It’s our 6th tutorial in JavaScript Series. As we have learned about the conditional statement and its types (if, if..else, If...else if) in the last article, a conditional statement is the most useful and common feature in the programming language. Switch is also a type of conditional statement and it will evaluate an expression against multiple possible cases and run one or more blocks of codes base on matching cases. The switched statement work almost as if...else if statement containing many blocks, and it does work so more efficiently than repeated if...else if statements. The switch statement is used to perform different action based on multiple cases. How does switch statement work? Syntax switch (expression) { case x: // case x code block (statement x) break; case y: // case y code block (statement y) break; default: // execute default code block (statement default) } As the name says break, When JavaScript reaches the break keyword, it breaks out of the switch block. It will only stop the execution of inside the block. It will continue until reaching the last break case. Eventually, reach the last case and the break keyword will end the switch block. If there is no case match then the default code block will run. There could be only one default keyword in the switch statement. The default keyword is optional, but it is ...
Hello everyone, I hope you are having a fine day. In today’s tutorial, I am going to discuss the if-else statement in JavaScript and what are conditional statements in detail. In programming, while writing a program there may be an occasion where you need to adopt one out of a given set of paths. In such a case, you need to use conditional statements that allow your program to make the correct decision. Conditional statements are used to run a specific action based on the result of the different conditions (true or false). If the condition would be true one action would be performed and if the condition is false then another action would be performed. A few examples of JavaScript conditional statements: We have the following conditions in JavaScripts. If statement plays a very important role in JavaScript to make decisions. It will decide whether the statement is true or false and only run if the statement is true. Otherwise, the code block will be ignored if the statement is false. Syntax if (condition) { // block of code that will excute if the condition is true } Note: if is a lowercase letter and If or IF will cause a JavaScript error. A simple example to see how if statement work in javascript. Let’s suppose you are going to pay your electricity bill through an app where you have a certain amount of money already in your account. Your account money is 5000 and you have to pay the electricity bill of 700. Using the <= help you in finding that whether you have less than or ...
Hello everyone, I hope you are having a good day. In today's tutorial, I am going to tell you about "Variables in JavaScript". The topic, I am going to highlight today, is how to declare variables in JavaScript and types of Variable? JavaScript has variables too as many other programming languages, so let's get started with it: Variable means anything that can vary(change). In JavaScript, Variable holds the data value, in simple words, JavaScript variables are containers and can store the data value. Variable in JavaScript are declared with var (reserved keyword). Syntax var (Variable-Name) = value; In this example, we have declared two variables using var: number, string. we have assigned each variable a different value. The data value of the number is '5' and string data value is 'Hello". Let's have a look at few other examples: In this picture, you can see that int X = 5; String str = "Learning" But in JavaScript, Variable will be automatically detected and you don't have to define their data type that if they are integer or string etc. var myVarname = 10; alert(myVarname); myVarname = "This is a string value"; alert(myVarname) Look in this above example, in the beginning, myVarname variable is treated as int numeric type and with alert. Following that, we have worked on myVarname again as a string and showed it. May you have noticed that we have not defined their data types. Storing the value of a variable is called variable initialization. You can store the value of the ...
Welcome back, guys! I hope you are well and having a great day. In today's tutorial, I will discuss the new topic " Basic Syntax and Rules in JavaScript". Learning grammar for a spoken language is necessary before you start writing it. There are rules and regulations you have to follow to write. Similarly, all programming languages have their grammar/syntax and rules which you have to follow in order to execute. Let me show you an example. Alert(“I am learning JavaScript”); This code sample has uppercase "A" and instead of printing the expected "I am learning JavaScript". The error will appear (alert is not defined) and code would not run. So it is important to be careful with syntax. Here are some rules you should keep in mind. alert(“I am learning JavaScript on https://www.theengineeringprojects.com/”); The syntax of comment is similar to CSS. JavaScripts c omments are used to explain or understand the code, and to make it more readable. Suggestions or warnings can help the end-user too. With the help of comment, you can stop code from execution while running or testing alternative code. There are two types of comment in JavaScript. Single line comment represents double slash forward (//). You can use it before and after the code. When you add these two forward slashes (//), all of the code/text to right of them will be ignored. Y ou can see an example in the below picture. The multi-line comment is more convenient than single-line comment, you can use it as a single line ...
Hello, I hope you all are doing well. In the previous tutorial, I shared a detailed introduction to JavaScript, where we discussed the basics. Today, I am going to tell you in detail How to Include Javascript Code in HTML Page and many more things that can help you understand JavaScript easily. All right guys let's revise what we have learned in the past article, you saw me adding script & /script code at the bottom of the tags. Today, I will show you in detail what was the reason for adding the tags at the bottom and how can you add an external JS file. If you want to be an expert programmer, you should have a look at this Oracle Java Certification, it will surely excel your programming skills. We have two methods to include the JS code in the HTML file. script type="text/javascript" alert("I am learning JavaScript"); script type="text/javascript" src="Test.js" /script So, short scripts like this can be added at the bottom of the body content in HTML pages. In case, your JS content is large, has more than 10 lines of code and is full of links here and there. It's time to show you how to do this. Create a new file by pressing Ctrl + N and add your script alert("I am learning JavaScript"); content in this file. Save it with the name "Test.Js". All JavaScript files have a JS ending. Now go back to the "index.html" file and add the code as you see down. When you refresh the web browser then it will automatically reload and JS file through the source code. Look down the image. ...
Hello friends, I hope you all are doing well. In today's tutorial, I am going to discuss What is a Thermal Flow Meter and How Does It Work? Let's begin! Thermal flow meters' main principle is to use the heat conductivity of both gases and liquids to determine its mass flow. Unlike flow meters that determine the volumetric flow rate like turbine flow meters or purge flow meters, thermal flow meters are resistant to temperature fluctuations and pressure of the substance’s pressure. This type of flow meter can also be used for measuring gas and airflow. Thermal flow meters have varying designs that are made specifically for different situations. A few of these designs have high-pressure and high-temperature features that are more capable of dealing with these specific cases. Thermal flow meters, using the thermal properties of the substance, measure the flow of a fluid flowing inside a duct or a pipe. Typically, a thermal flow meter introduces a specific amount of heat to its sensor. Some of the heat dissipates, and as the flow increases, the more heat will be lost, which will then be picked up by the sensor. With this data, the measurement of the fluid flow will then be determined. The amount of heat that is lost in the fluid depends entirely on the design of the sensor used in the flow meter and the fluid’s properties, especially its heat conductivity. In most applications, the thermal properties of the liquid measured can vary in temperature and pressure. These varying ...
Hi Guys! I hope you are doing great. In today's tutorial, we are going to discuss h ow to streamline your contract management process with detail. Running a business involves maintaining a lot of processes. From developing a new product or service to updating your company website, every decision or change your business chooses to undertake can involve many more steps than you realize. Contract creation and management are some of these necessary processes that your company will have to take on eventually. It can quickly become messy, having to juggle lots of different parties, needs, and obligations. Not knowing how to navigate through the process can lead to bottlenecking during certain stages. One of the top contract management best practices is streamlining your contract management process. Streamlining your contract management process will not only make things operate much faster but also ensure that nothing crucial gets missed along the way. With so many legal technicalities that could get missed throughout the lengthy process, it is absolutely critical that your process is as streamlined as possible. Before you even engage in the contract creation process, one great tip for time-saving is to draft contract templates for different uses. This is one of the most common contract management best practices that any relevant business will tell you. By standardizing certain clauses, phrasing, and structures for different contracts, you will save a lot of time later on. Having ...