forked from extern/naming-cheatsheet
@ -166,7 +166,7 @@ function getFruitsCount() {
|
|||||||
Sets a variable in a declarative way, with value `A` to value `B`.
|
Sets a variable in a declarative way, with value `A` to value `B`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const fruits = 0
|
let fruits = 0
|
||||||
|
|
||||||
function setFruits(nextFruits) {
|
function setFruits(nextFruits) {
|
||||||
fruits = nextFruits
|
fruits = nextFruits
|
||||||
@ -182,7 +182,7 @@ Sets a variable back to its initial value or state.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
const initialFruits = 5
|
const initialFruits = 5
|
||||||
const fruits = initialFruits
|
let fruits = initialFruits
|
||||||
setFruits(10)
|
setFruits(10)
|
||||||
console.log(fruits) // 10
|
console.log(fruits) // 10
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user