@codingwithleo (@codingwithleo) header
@codingwithleo (@codingwithleo) profile picture

I do the codes + the coffees

Joined June 2019
Photo by @codingwithleo (@codingwithleo)Photo by @codingwithleo (@codingwithleo)Photo by @codingwithleo (@codingwithleo)Photo by @codingwithleo (@codingwithleo)Photo by @codingwithleo (@codingwithleo)Photo by @codingwithleo (@codingwithleo)Photo by @codingwithleo (@codingwithleo)Photo by @codingwithleo (@codingwithleo)Photo by @codingwithleo (@codingwithleo)Photo by @codingwithleo (@codingwithleo)
What is a for loop? A for loop is a statement to iterate over arrays or objects.⁠⠀ ⁠⠀ It consists of 3 parts, the initialization, the condition and the final expression (which in most cases is an incremental value).⁠⠀ ⁠⠀ In this example, the for … ift.tt/2LqMt3q
What is scope? Scope in JavaScript simply means "where an element, data, or value can actually be used" in the script. ⁠⠀ ⁠⠀ In JavaScript, we have two kinds of scope, global scope and local scope.⁠⠀ ⁠⠀ When creating a function a new scope is est… ift.tt/2QhJWxd
What is the "..." spread operator? The spread operator allows an iterable to spread or expand individually inside a receiver. Iterables are anything that can be looped over such as strings, arrays, and sets. ⁠⠀ ⁠⠀ Screenshot output would return..… ift.tt/33W7Q46
What is the Logical AND (&&) operator? The logical operators are typically used with Boolean (logical) values. When they are, they return a Boolean value. ⁠⠀ ⁠⠀ Syntax = (condition) ? true : false.⁠⠀ ⁠⠀ // Screenshot return value is: "I'm logged … ift.tt/2YWnOHD
What is the Conditional (Ternary) Operator? The ternary operator is a way to shorten your IF statement into one line of code.⁠⠀ ⁠⠀ To break this down a bit further...⁠⠀ ⁠⠀ 1. The condition is what you’re actually testing. The result of your condi… ift.tt/2YLbYQy
What is an if statement? The if statement executes a statement if a specified condition is truthy. If the condition is falsy, another statement can be executed.⁠⠀ ⁠⠀ #javascript #js #ifstatment #jsconditional #code #webdev #devlife #webdevelopment #p… ift.tt/2GzcTwX
1
1
What is the Array.reduce() method? Array.reduce() is a method that takes the input values of an array and returns a single value. It uses callback function which consists of an accumulator (a value that accumulates each piece of the array), the value its… ift.tt/2LCUnrU
What is the Array.filter() method? Array.filter() is a very handy shortcut when we have an array of values and want to filter those values into another array, where each value in the new array is a value that passes a specific test.⁠⠀ ⁠⠀ // Screensho… ift.tt/2LWpqOK
What is a JavaScript boolean? A boolean is a datatype that returns either of two values i.e. true or false. In JavaScript, boolean is used as a function to get the value of a variable, object, conditions, expressions etc. in terms of true or false.⁠⠀… ift.tt/2O1cPfQ
What is a JavaScript object? Objects in JavaScript are collections of key/value pairs. The values can consist of properties and methods, and may contain all other JavaScript data types, such as strings, numbers, and Booleans.⁠⠀ ⁠⠀ #javascript #js #le… ift.tt/2JzmuGa
What is an Array? An array is a single variable that is used to store different elements. It is often used when we want to store list of elements and access them by a single variable. ⁠⠀ ⁠⠀ #javascript #javascriptarray #array #js #learningtocode #lea… ift.tt/30Ak4gg
1
What is var? Unlike some of it's companions var is rather a keyword which defines a variable globally regardless of block scope.⁠⠀ ⁠⠀ #javascript #javascriptcode #learnjavascript #learningjavascript #javascript101 #codenewbie #webdev #webdevelopment … ift.tt/2LMkk7E
1
1
What is let? let allows you to declare variables that are limited to a scope of a block statement, or expression on which it is used.⁠⠀ ⁠⠀ #javascript #javascriptcode #javascriptsyntax #learnjavascript #learningjavascript #javascript101 #codenewbie #… ift.tt/2XKNoyJ
1
What is const? Constants are block-scoped, much like variables defined using the let statement. The value of a constant cannot change through reassignment, and it can't be redeclared.⁠⠀ ⁠⠀ #javascript #javascriptcode #javascriptsyntax #learnjavascrip… ift.tt/2NXdf74
How to write an arrow function in Javascript. In this example you can see that the function itself has been assigned to the "arrowFunction" variable.⁠⠀ ⁠⠀ You'll also notice that we have the one parameter defined - this means the parentheses do not a… ift.tt/2xCv6oN
1
Example component showing the useEffect hook being implemented.⁠⠀ ⁠⠀ Reminder: The Effect Hook lets you perform side effects in function components.⁠⠀ ⁠⠀ #react #reactjs #javascript #js #learntocode #frontenddev #webdev #webdevelopment #programmi… ift.tt/307ESv2
2
How to use Effect React Hooks by importing the {useEffect} single named export. ⁠⠀ ⁠⠀ If you're familiar with React class lifecycle methods, you can think of useEffect Hook as componentDidMount, componentDidUpdate, and componentWillUnmount combin… ift.tt/2xv0Mfy