Зміст курсу
Introduction to JavaScript
Introduction to JavaScript
2. JavaScript syntax
JavaScript SyntaxJavaScript VariablesJavaScript OperatorsIdentifiers in JavaScriptNaming IdentifiersReserved keywords in JavaScriptNaming Convention in JavaScript. Case StylesVariables Naming ConventionBoolean Naming ConventionConstant Naming ConventionFunction & Classes Naming ConventionMultiline StringsMultiline Strings. ConcatenatingCommenting in JavaScriptCommenting in JavaScript. Multi-line Comments
3. Data Types and Variables
What are Variables?What are Data-types?JavaScript and Type ConversionVar 1/3Var 2/3Var 3/3Let 1/2Let 2/2Constant 1/3Constant 2/3Constant 3/3Number 1/3Number 2/3Number 3/3Boolean 1/4Boolean 2/4Boolean 3/4Boolean 4/4Strings 1/5Strings 2/5Strings 3/5Strings 4/5Strings 5/5BigInt 1/3BigInt 2/3BigInt 3/3Symbols 1/3Symbols 2/3Symbols 3/3NullUndefinedNull vs Undefined
Number 2/3
Rounding of Numbers
Rounding is one of the most frequent operations on the numbers. JavaScript provides several built-in functions for rounding which are given in the below table.
Function | Description | Example |
---|---|---|
Math.floor() | Rounds off to the lower limit | 3.1 becomes 3 , and -1.1 becomes -2 . |
Math.ceil() | Rounds off the number to the upper limit | 3.1 becomes 4 , and -1.1 becomes -1 . |
Math.round() | Rounds off the nearest integer when value is equal or greater than .5 | 3.1 becomes 3 , 3.6 becomes 4 , and 3.5 rounds up to 4 (the middle case) |
Завдання
Swipe to start coding
A variable named price
with the assigned value of 4.7
has been given to you. Your task is to round off this variable such that we get 4
as the output.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 13
Number 2/3
Rounding of Numbers
Rounding is one of the most frequent operations on the numbers. JavaScript provides several built-in functions for rounding which are given in the below table.
Function | Description | Example |
---|---|---|
Math.floor() | Rounds off to the lower limit | 3.1 becomes 3 , and -1.1 becomes -2 . |
Math.ceil() | Rounds off the number to the upper limit | 3.1 becomes 4 , and -1.1 becomes -1 . |
Math.round() | Rounds off the nearest integer when value is equal or greater than .5 | 3.1 becomes 3 , 3.6 becomes 4 , and 3.5 rounds up to 4 (the middle case) |
Завдання
Swipe to start coding
A variable named price
with the assigned value of 4.7
has been given to you. Your task is to round off this variable such that we get 4
as the output.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 3. Розділ 13