Create a function comparisonOperators that compares two numbers using >, <, ==, and ===. Log each result.
basicArithmetic
4 months agoCreate a function basicArithmetic that adds, subtracts, multiplies, divides, and uses modulus on two numbers and logs each result.
decrementOperator
4 months agoCreate a function decrementOperator that declares a variable, decrements it using --, and logs the result.
incrementOperator
4 months agoCreate a function incrementOperator that declares a variable, increments it using ++, and logs the result.
assignmentOperator
4 months agoCreate a function assignmentOperator that uses += and *= on a number and logs the result after each operation.
comparisonOperators
4 months agoCreate a function comparisonOperators that compares two numbers using >, <, ==, and ===. Log each result.
ternaryOperator
4 months agoCreate a function ternaryOperator that checks if a number is even or odd using the ternary operator and logs the result.
logicalOperators
4 months agoCreate a function logicalOperators that uses && and || to combine two boolean variables and logs the result.
typeCoercion
4 months agoCreate a function typeCoercion that adds a number and a string together, then logs the result and its type.
multiplyAndAdd
4 months agoCreate a function multiplyAndAdd that multiplies two numbers and adds a third number to the result. Log the final value.
postPreIncrement
4 months agoCreate a function postPreIncrement that shows the difference between post-increment and pre-increment.
logicalNot
4 months agoCreate a function logicalNot that takes a boolean and logs the opposite using the ! operator.
compoundAssignment
4 months agoCreate a function compoundAssignment that shows the use of -= and /= operators on a number.
strictVsLooseEquality
4 months agoCreate a function strictVsLooseEquality that compares '5' and 5 using == and === and logs the results.
nestedTernary
4 months agoCreate a function nestedTernary that logs 'positive', 'zero', or 'negative' depending on the input number.
coercionAddition
4 months agoCreate a function coercionAddition that adds true + 2 and logs the result and its type.