shadowing objects properties in javascript

When creating a property on an object that has the same property name on its prototype chain it will shadow the property on its prototype. This means that the property defined on the object will always be found first instead of looking through the prototype for the property.


let myName = {
  name: 'Brian'

// make the 'myName' object be in the prototype of 'yourName'
let yourName = Object.create(myName);; // Brian = 'Daniel';; // Daniel

yourName.__proto__; // {name: "Brian"}

When creating the new property ‘name’ on the yourName object it shadows the ‘name’ property on the prototype.

dynamic image source create-react-app

how to load images with different sources / url with create react app

function declarations in JavaScript

In JavaScript functions can be declared with function statements, anonymous functions and arrow functions.