Search Results
84 items found for ""
- JS : else Statement
OK, so we've seen that when the code block evaluates to false using the if statement, the action is skipped, but what if we want to do something else. Well, we definitely use the "else" statement! We can use the else statement to specify a block of code that will be executed if the condition is false. Which are exactly like this: <> Code Syntax : Conscious! - You can omit the curly braces if there is only one command in the code under the condition. Here's another example of if and else statements are working together: <> Code Example : Let's translate this example and try to understand it: If myNum1 is greater than myNum2, alert "This is my first condition"; Otherwise, alert "This is my second condition"; So the browser will print out the second condition as 7 which is not greater than 10. Conscious! - Another way to use this check is with the question mark (?) operator: a > b? alert(a): alert(b) #JavaScriptForBeginners #WebDevelopmentForBeginners
- JS : The if Statement
Great! You are making great progress and stay tuned. Often when we write code, we want to perform different actions based on different circumstances. And that's where conditional statements come in which means conditional statements. There are a bunch of different conditions to cover, but we're starting with one of the most useful: "if" We use if to specify a block of code that we want to execute if a specified condition or statement is true. <> Code Syntax : In its simplest form, an if statement has a single if condition. It executes a set of statements only if that condition is true. <> Code Example : Here's a little more detail on the if statement. This is an example of a false conditional statement: <> Code Example : Because the condition evaluates to false, the alert statement is skipped and the program continues with the line after the closing curly brace of the if statement. Conscious! - if must be in lowercase letters. Because capital letters (if or IF) won't work. #JavaScriptForBeginners #WebDevelopmentForBeginners
- JavaScript : Comparison Operator
Comparison operators are used in logical statements to determine the similarity or difference between variables or values. <> Code Example : == True if x is equal to y. === True if x is equal to y, and they are of the same type. != True if x is not equal to y. !=== True if x is not equal to y, or they are not of the same type. < True if x is smaller than y. > True if x is greater than y. >= True if x is greater than or equal to y. <= True if x is less than or equal to y. <> Code Example: We can use comparison operators or comparison operators in logical statements to find out whether variables or values are different. You either get true or false. For example, the equals (==) operator checks whether the values of the operands are equal. <> Code Example : Conscious! - You can compare all types of data with comparison operators, they always return true or false. Check out this table to see an analysis of comparison operators. Conscious! - When we use operators, one important thing to remember is that they only work. when they are comparing the same data type; Numbers with numbers, string with strings, you get the idea. #JavaScriptForBeginners #WebDevelopmentForBeginners
- JS : Increment & Decrement Operator
"Wait, I've heard of increments, but what are these decrements after all?" We hear some of you say. OK, throw an increment in reverse and reputation, you've got your app a decrement. Let's try to know a little deeper... Increment and decrement operators are used to increase or decrease the value of a variable. <> कोड उदाहरण : * * is used for exponentiation. + + is used to increase or addition. - - is used for subtraction. i. Increment Operator + + Increment operators increase the numerical value of their operands by 1. When placed before the operand, it will return the incremented value. When placed thereafter, it will return the original or original value and then increment the operand. ii. Decrement Operator - - The decrement operator decreases the numerical value of its operand by 1. When placed before the operand, it will return the subtracted value. When placed after the operand, will return the original or original value and then subtract the operand. <> कोड उदाहरण : The ++ and - - operators can be used before and after the operands. When you use the increment/decrement operator after the operand, the value will be returned before the operand is incremented/decremented. <> कोड उदाहरण : Conscious ! - You can use parentheses to change the order of arithmetic operations, just as you learned in school in math. like this: var x = (100 + 50) * 3; #JavaScriptForBeginners #WebDevelopmentForBeginners
- JavaScript : Assignment Operator
The next very logically named operator in a chain is... assignment operator! And as you might have guessed, we use these to assign values to variables in JavaScript. Assignment operators assign special values to variables. = Specifies a value for the variable. += Assigns to the variable and adds the value. -= Assigns a value to a variable and subtracts it. *= assigns a value to the variable and does the multiplication. /= Specifies the value and splits the variable. %= Specifies and adds the modulus or modulus to the variable. <> कोड उदाहरण : Conscious! - You can use multiple assignment operators in one line, such as x -= y += 9 #JavaScriptForBeginners #WebDevelopmentForBeginners
- JavaScript : Embedding JS Code
You can embed JS code directly into your web pages by placing them between tags. The
- JavaScript : Adding JS to Web Pages
There are 3 ways to add JavaScript to a web page. Embedding JS code between tags. Creating an external JS file via the src attribute of the
- Ready. Set. JavaScript!
Let's start with the basics and add some JavaScript to the webpage. On the web, JavaScript code resides inside an HTML document, and needs to be enclosed by : <> कोड उदाहरण : Conscious! - You can place the script tag anywhere in it - HTML document. Output Let's say "Hello, World!" in the browser. Use Javascript to print. This is what it will look like. <> Code Example : document.write() is a function. This is what we need to use to write text in our HTML document. You can also use standard HTML markup language to customize the appearance text in the output: <> Code Example : Conscious! - document.write() should only be used for testing. We'll be covering some other output mechanisms in real soon. Output To Console Ok, now we are expert in writing HTML output with document.write(). There are times for a different type of output. Let's learn about the output of the browser console. For this we will need the reliable console.log() function. Wait, not so fast! Which console are we talking about? The console is part of a web browser and allows you to log messages, run JavaScript code, and view errors and warnings. <> Code Example : Conscious! - Developers mostly use console for their testing - Javascript code. #JavaScriptForBeginners #WebDevelopmentForBeginners
- JavaScript Lesson Challenges : 01
Just 10 Quiz Quizzes. You will have only 15 seconds for each question. Once you have selected your answer, it cannot be undone. You cannot select any option after the timeout. You cannot exit the quiz while playing. You will get marks on the basis of your correct answers. Click "Start Quiz" button to start quizzes. #JavaScriptForBeginners #BeginnersWebDevelopment
- JS : What is included in this tutorial?
This tutorial covers all the basic JS concepts including data types, operators, creating and using variables, generating output. You will learn the basics of JS through both theory and practice. Also, you will understand why it is necessary to know JavaScript? Because it is one of the three main web development languages along with HTML and CSS. Once you get comfortable with the basics, you'll move on to the next level that explains objects or views of objects, the Document Object Model (DOM) and the Browser Object Model (BOM). And finally, you can learn some advanced concepts such as EventListeners, Event Propagation, method borrowing from other objects, JavaScript's hoisting behavior, encoding and decoding JSON data as well as new features introduced in ECMAScript 6 (or ES6) Will take a detailed look. #JavaScriptForBeginners #BeginnersWebDevelopment
- JS World
JavaScript (or JS for short) is a lightweight, dynamic scripting language designed to support prototype-based programming. It is mainly used for front-end development, but it also has a Node.js framework for server-side scripting. Developers praise the Node.js server for its stability and fast rendering on both the browser and the server. Therefore, its popularity is increasing rapidly. Conscious ! - In this course, we will cover JavaScript for Front End Development. If you're not familiar with HTML and CSS, check out our web courses. #JavaScriptForBeginners
- Introduction To JavaScript
JavaScript is one of the essential languages to learn for a web developer. Along with HTML and CSS, JavaScript creates an interesting and dynamic user interface of the site. Originally developed by Netscape in the mid-1990s as LiveScript. It was later renamed to JavaScript in 1995 and became an ECMA standard in 1997. #JavaScriptForBeginners