Skip to content

Commit f6cff1b

Browse files
author
adeniyi
committed
Testing my commit for Atom IDE
1 parent d9fb768 commit f6cff1b

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

README.md

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
**[⬆ Back to Top](#table-of-contents)**
5757
### How to generate a random number in a given range
5858
```javascript
59-
// Returns a random number(float) between min (inclusive) and max (exclusive)
59+
// Returns a random number(float) between min (inclusive) and max (exclusive)
6060

6161
const getRandomNumber = (min, max) => Math.random() * (max - min) + min;
6262

@@ -117,8 +117,8 @@ console.log('difference',difference(firstArr, secondArr))
117117
### Convert truthy falsy to boolean
118118

119119
```javascript
120-
const myVar = null;
121-
const mySecondVar = 1;
120+
const myVar = null;
121+
const mySecondVar = 1;
122122

123123
console.log( Boolean(myVar) ) // false
124124
console.log( !!myVar ) // false
@@ -150,8 +150,8 @@ Array(6).join('👽')
150150
### Check how long an operation takes
151151
```javascript
152152
//The performance.now() method returns a DOMHighResTimeStamp, measured in milliseconds.
153-
//performance.now() is relative to page load and more precise in orders of magnitude.
154-
//Use cases include benchmarking and other cases where a high-resolution time is required
153+
//performance.now() is relative to page load and more precise in orders of magnitude.
154+
//Use cases include benchmarking and other cases where a high-resolution time is required
155155
//such as media (gaming, audio, video, //etc.)
156156

157157
var startTime = performance.now();
@@ -226,7 +226,7 @@ function copyToClipboard() {
226226
const copyText = document.getElementById("myInput");
227227
copyText.select();
228228
document.execCommand("copy");
229-
229+
230230
}
231231
//new API
232232
function copyToClipboard(){
@@ -254,7 +254,7 @@ console.log(degree) //Masters
254254
```
255255

256256
**[⬆ Back to Top](#table-of-contents)**
257-
### URLSearchParams
257+
### URLSearchParams
258258

259259

260260
```javascript
@@ -283,14 +283,14 @@ const countMyFruits = myFruits.reduce((countFruits,fruit) => {
283283
},{} )
284284
console.log(countMyFruits)
285285
// { Apple:3, Banana:1, Mango:2, Orange:1 }
286-
286+
287287
//seconf option
288288
const fruitsCounter = {};
289-
289+
290290
for( const fruit of myFruits ){
291291
fruitsCounter[fruit] = fruitsCounter[fruit] ? fruitsCounter[fruit]+1 :1;
292292
}
293-
293+
294294
console.log(fruitsCounter)
295295
// { Apple:3, Banana:1, Mango:2, Orange:1 }
296296
```
@@ -303,7 +303,7 @@ const countMyFruits = myFruits.reduce((countFruits,fruit) => {
303303

304304
//There are cases where you want the destructured variable to have a different name than the property name
305305

306-
const obj = {
306+
const obj = {
307307
name: "JSsnippets"
308308
};
309309

@@ -340,7 +340,7 @@ Object.is(foo, bar); // false
340340

341341

342342
```javascript
343-
const obj = {
343+
const obj = {
344344
name: "JSsnippets",
345345
age:29,
346346
address:{
@@ -370,12 +370,12 @@ Object.isFrozen(obj) //true
370370

371371

372372
```javascript
373-
const obj = {
373+
const obj = {
374374
name: "JSsnippets",
375375
age:29,
376376
};
377377

378-
//Object.entries() method is used to return an array consisting of enumerable property
378+
//Object.entries() method is used to return an array consisting of enumerable property
379379
//[key, value] pairs of the object which are passed as the parameter.
380380

381381
for(let [key,value] of Object.entries(obj)){
@@ -416,7 +416,7 @@ window.addEventListener('contextmenu', ()=>{
416416
//Async is more useful when you really don't care when the script loads and nothing else that is user dependent depends upon that script loading.(for scripts likes Google analytics)
417417
<script async src="myscript.js"></script>
418418

419-
//With defer, browser will run your script when the page finished parsing. (not necessary finishing downloading all image files.
419+
//With defer, browser will run your script when the page finished parsing. (not necessary finishing downloading all image files.
420420
<script defer src="myscript.js"></script>
421421
```
422422

@@ -454,16 +454,16 @@ console.log(carColor);
454454
//Now this new optional chaining operator will let us be even more fancy:
455455

456456
const newCarColor = car?.name?.color;
457-
console.log(newCarColor)
457+
console.log(newCarColor)
458458
//undefined- no error
459-
459+
460460
//You can use this syntax today using @babel/plugin-proposal-optional-chaining
461461
```
462462
463463
**[⬆ Back to Top](#table-of-contents)**
464464
### globalThis
465465
```javascript
466-
Accessing the global property in JavaScript has always posed some difficulty. This is because
466+
Accessing the global property in JavaScript has always posed some difficulty. This is because
467467
different platforms have different ways to access it.
468468

469469
Client-side JavaScript uses window or self
@@ -472,7 +472,7 @@ Node.js uses global
472472

473473
Web workers use self
474474

475-
The globalThis property provides a standard way of accessing the global 'this' value across environments. you can access the global object in a consistent manner without having to know which environment the code is being run in.
475+
The globalThis property provides a standard way of accessing the global 'this' value across environments. you can access the global object in a consistent manner without having to know which environment the code is being run in.
476476

477477
console.log(globalThis) //get the global this depends on your environment
478478

@@ -596,7 +596,7 @@ observer.observe(image);
596596
```
597597
598598
**[⬆ Back to Top](#table-of-contents)**
599-
### Notify when element size is changed
599+
### Notify when element size is changed
600600
see our codepen: https://codepen.io/JSsnippets/pen/dyYoYVX
601601
```javascript
602602
const foo = document.getElementById("foo");
@@ -620,10 +620,10 @@ see our codepen: https://codepen.io/JSsnippets/pen/gOapPzq
620620
const video = document.getElementById("my-video");
621621

622622
const onVisibilitychange =()=>{
623-
return document.hidden
624-
? video.pause()
623+
return document.hidden
624+
? video.pause()
625625
: video.play();
626-
}
626+
}
627627

628628
document.addEventListener("visibilitychange", onVisibilitychange)
629629

@@ -674,7 +674,7 @@ pasteBox.onpaste = (e) => {
674674
675675
676676
**[⬆ Back to Top](#table-of-contents)**
677-
### The void operator
677+
### The void operator
678678
The void operator evaluates the given expression and then returns undefined.
679679
```javascript
680680

@@ -691,7 +691,7 @@ void anyfunction(); //returns undefined
691691
692692
693693
**[⬆ Back to Top](#table-of-contents)**
694-
### replaceAll
694+
### replaceAll
695695
the method string.replaceAll(search, replaceWith) replaces all appearances of search string with replaceWith.
696696
```javascript
697697
@@ -725,7 +725,7 @@ const updatedStr = str.replaceAll('example', 'snippet'); //'this is a JSsnippets
725725
726726
727727
**[⬆ Back to Top](#table-of-contents)**
728-
### Required Function Params
728+
### Required Function Params
729729
Expanding on the default parameter technique, we can mark a parameter as mandatory
730730
731731
```javascript
@@ -758,7 +758,7 @@ console.log(getPage());
758758
<input type="number" id="JSsnippets" onkeyup="checkMyType(event)" />
759759
760760
function checkMyType(event){
761-
761+
762762
console.log(typeof event.target.value) // string
763763
console.log(typeof event.target.valueAsNumber ) // number
764764
@@ -913,7 +913,7 @@ const startSpeaking=()=>{
913913
914914
let msg = document.getElementById("text-to-speech").value;
915915
let speech = new SpeechSynthesisUtterance();
916-
916+
917917
speech.lang = "en-US";
918918
speech.text = msg;
919919
speech.volume = 1;
@@ -925,3 +925,6 @@ const startSpeaking=()=>{
925925
926926
927927
```
928+
/* Testing commit from Atom
929+
930+
and the other things I need to do */

0 commit comments

Comments
 (0)