/
tutorials.js
3818 lines (3813 loc) · 155 KB
/
tutorials.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'use strict';
const moment = require('moment');
const axiosPath = require('./axiosPath');
const tutorials = [
{
title: 'The `afterEach()` Hook in Mocha',
raw: './tutorials/mocha/aftereach.md',
url: '/tutorials/mocha/aftereach',
description: 'Here\'s how Mocha\'s afterEach() hook works.',
tags: ['mocha'],
date: moment('2023-08-25')
},
{
title: 'Check if a Date is Valid in JavaScript',
raw: './tutorials/fundamentals/check-if-date-is-valid.md',
url: '/tutorials/fundamentals/check-if-date-is-valid',
description: 'Got a JavaScript date that is showing up as "Invalid Date" in your console? Here\'s how you check for that.',
tags: ['fundamentals'],
date: moment('2023-08-14')
},
{
title: 'Encode base64 in JavaScript',
raw: './tutorials/fundamentals/encode-base64.md',
url: '/tutorials/fundamentals/encode-base64',
description: 'Here\'s how you can use the btoa() function in JavaScript to convert strings to base64. Also describes how to convert strings to base64 using Node.js buffers.',
tags: ['fundamentals'],
date: moment('2023-08-11')
},
{
title: 'Assertions in Mocha',
raw: './tutorials/mocha/assertions.md',
url: '/tutorials/mocha/assertions',
description: 'Mocha doesn\'t have a built-in assertion library, but here are a few options.',
tags: ['mocha'],
date: moment('2023-08-09')
},
{
title: 'Using `it.skip()` in Mocha',
raw: './tutorials/mocha/it-skip.md',
url: '/tutorials/mocha/it-skip',
description: 'Here\'s how `it.skip()` works in Mocha',
tags: ['mocha'],
date: moment('2023-08-04')
},
{
title: 'Working with Timezones using date-fns and date-fns-tz',
raw: './tutorials/date-fns/tz.md',
url: '/tutorials/date-fns/tz',
description: 'Here\'s how you can use date-fns-tz to work with timezones, and alternatives for working with timezones in vanilla JS.',
tags: ['date-fns'],
date: moment('2023-08-02')
},
{
title: 'The `before()` Hook in Mocha',
raw: './tutorials/mocha/before.md',
url: '/tutorials/mocha/before',
description: 'Here\'s how Mocha\'s before() hook works, and when you should use it.',
tags: ['mocha'],
date: moment('2023-07-31')
},
{
title: 'Run Just a Single Test in Mocha',
raw: './tutorials/mocha/run-single-test.md',
url: '/tutorials/mocha/run-single-test',
description: 'Here\'s two ways you can run just one test out of a Mocha test suite.',
tags: ['mocha'],
date: moment('2023-07-29')
},
{
title: 'The `beforeEach()` Hook in Mocha',
raw: './tutorials/mocha/beforeeach.md',
url: '/tutorials/mocha/beforeeach',
description: 'Here\'s how Mocha\'s beforeEach() hook works.',
tags: ['mocha'],
date: moment('2023-07-19')
},
{
title: 'Check if URL Contains a String',
raw: './tutorials/fundamentals/if-url-contains.md',
url: '/tutorials/fundamentals/if-url-contains',
description: 'Here\'s how you can check if the current URL contains a given string in JavaScript.',
tags: ['fundamentals'],
date: moment('2023-07-12')
},
{
title: 'How To Fix "__dirname is not defined" Error in Node.js',
raw: './tutorials/node/__dirname-is-not-defined.md',
url: '/tutorials/node/__dirname-is-not-defined',
description: 'The "__dirname is not defined" error is usually due to using ESM. Here\'s how you can fix this error.',
tags: ['node'],
date: moment('2023-07-10')
},
{
title: 'JavaScript Add Month to Date',
raw: './tutorials/fundamentals/add-month-to-date.md',
url: '/tutorials/fundamentals/add-month-to-date',
description: 'Here\'s how you can add a month to a JavaScript Date without using external libraries. We also have examples using date-fns or Luxon.',
tags: ['fundamentals'],
date: moment('2023-07-07')
},
{
title: 'JavaScript Add Days to Date',
raw: './tutorials/fundamentals/date-add-days.md',
url: '/tutorials/fundamentals/date-add-days',
description: 'Here\'s how you can add days to a Date without using external libraries, or using date-fns or Luxon.',
tags: ['fundamentals'],
date: moment('2023-06-21')
},
{
title: '3 Patterns to Merge Arrays in JavaScript',
raw: './tutorials/fundamentals/merge-arrays.md',
url: '/tutorials/fundamentals/merge-arrays',
description: 'Here\'s 3 different ways to merge arrays in JavaScript, including trade-offs between them.',
tags: ['fundamentals'],
date: moment('2023-05-28')
},
{
title: 'Convert a BigInt to a Number in JavaScript',
raw: './tutorials/fundamentals/bigint-to-number.md',
url: '/tutorials/fundamentals/bigint-to-number',
description: 'You can convert BigInts to numbers using the `Number()` constructor, with a few caveats. Here\'s what you need to know.',
tags: ['fundamentals'],
date: moment('2023-04-25')
},
{
title: 'The callsFake() Function in Sinon',
raw: './tutorials/sinon/callsfake.md',
url: '/tutorials/sinon/callsfake',
description: 'Sinon\'s callsFake() function lets you configure what a stub function returns. Here\'s what you need to know.',
tags: ['sinon'],
date: moment('2023-04-21')
},
{
title: 'Configuring maxBodyLength in Axios',
raw: './tutorials/axios/maxbodylength.md',
url: '/tutorials/axios/maxbodylength',
description: 'Axios\' maxBodyLength property provides a neat way to add a maximum size for HTTP request bodies. Here\'s what you need to know.',
tags: ['axios'],
date: moment('2023-04-07')
},
{
title: 'The parseInt Function in JavaScript',
raw: './tutorials/fundamentals/parseint.md',
url: '/tutorials/fundamentals/parseint',
description: 'Here\'s what you need to know about JavaScript\'s `parseInt()` function.',
tags: ['fundamentals'],
date: moment('2023-04-04')
},
{
title: 'Working with UUID in Node',
raw: './tutorials/node/uuid.md',
url: '/tutorials/node/uuid',
description: 'Here\'s what you need to know about Node\'s built-in uuid functionality.',
tags: ['node'],
date: moment('2023-03-28')
},
{
title: 'Convert Callbacks to Async/Await with OpenAI',
raw: './tutorials/tools/callback-to-async-await.md',
url: '/tutorials/tools/callback-to-async-await',
description: 'Here\'s a tool to convert short JavaScript snippets from callbacks to async/await using ChatGPT 3.5.',
tags: ['tools'],
date: moment('2023-03-21')
},
{
title: 'Lodash Playground',
raw: './tutorials/tools/lodash-playground.md',
url: '/tutorials/tools/lodash-playground',
description: 'Here\'s a playground to test out Lodash in your browser.',
tags: ['tools'],
date: moment('2023-03-15')
},
{
title: 'The toFixed() Function in JavaScript',
raw: './tutorials/fundamentals/tofixed.md',
url: '/tutorials/fundamentals/tofixed',
description: 'The `toFixed()` function converts a number to a string rounded to a certain number of decimal places. Here\'s what you need to know.',
tags: ['fundamentals'],
date: moment('2023-03-14')
},
{
title: 'The Nullish Coalescing Operator ?? in JavaScript',
raw: './tutorials/fundamentals/nullish-coalescing.md',
url: '/tutorials/fundamentals/nullish-coalescing',
description: 'Here\'s how the nullish coalescing operator in JavaScript works',
tags: ['fundamentals'],
date: moment('2023-03-07')
},
{
title: 'Handling onClick Events on ChartJS Bar Charts',
raw: './tutorials/chartjs/onclick-bar-chart.md',
url: '/tutorials/chartjs/onclick-bar-chart',
description: 'Here\'s how you can find what bar in a bar chart the user clicked on in ChartJS 4 and ChartJS 2+3',
tags: ['chartjs'],
date: moment('2023-03-01')
},
{
title: 'Implementing Tuples in JavaScript',
raw: './tutorials/fundamentals/tuple.md',
url: '/tutorials/fundamentals/tuple',
description: 'JavaScript doesn\'t have a built-in tuple type, but here\'s how you can implement one.',
tags: ['fundamentals'],
date: moment('2023-02-22')
},
{
title: 'Convert a JavaScript Enum to a String',
raw: './tutorials/fundamentals/enum-to-string.md',
url: '/tutorials/fundamentals/enum-to-string',
description: 'Here\'s how you can convert a TypeScript or JavaScript enum to a string, or enum value to a string.',
tags: ['fundamentals'],
date: moment('2023-02-20')
},
{
title: 'JavaScript Optional Chaining with Array Index',
raw: './tutorials/fundamentals/optional-chaining-array.md',
url: '/tutorials/fundamentals/optional-chaining-array',
description: 'Here\'s how to use JavaScript\'s optional chaining with array indexes.',
tags: ['fundamentals'],
date: moment('2023-02-15')
},
{
title: 'Using Lodash\'s omit() Function',
raw: './tutorials/lodash/omit.md',
url: '/tutorials/lodash/omit',
description: 'Here\'s how to use Lodash\'s `omit()` function to exclude properties from an object. Also includes a vanilla JS alternative for `omit()`.',
tags: ['lodash'],
date: moment('2023-02-10')
},
{
title: 'How to Add 2 Arrays Together in JavaScript',
raw: './tutorials/fundamentals/add-arrays.md',
url: '/tutorials/fundamentals/add-arrays',
description: 'Here\'s 3 ways you can add two arrays together in vanilla JavaScript, no libraries required.',
tags: ['fundamentals'],
date: moment('2023-02-07')
},
{
title: 'The String `match()` Function in JavaScript',
raw: './tutorials/fundamentals/string-match.md',
url: '/tutorials/fundamentals/string-match',
description: 'JavaScript\'s String `match()` function lets you test whether a string matches a given regexp. It also has some neat tricks for advanced users using regexp groups.',
tags: ['fundamentals'],
date: moment('2023-02-02')
},
{
title: 'How to Load Chart.js from CDNs',
raw: './tutorials/chartjs/cdn.md',
url: '/tutorials/chartjs/cdn',
description: 'Here\'s how you can import Chart.js from JSDelivr, Cloudflare, or unpkg in your HTML files.',
tags: ['chartjs'],
date: moment('2023-01-30')
},
{
title: 'Convert a Set to an Array in JavaScript',
raw: './tutorials/fundamentals/set-to-array.md',
url: '/tutorials/fundamentals/set-to-array',
description: 'Here\'s how you can convert a JavaScript Set to an array with no external dependencies.',
tags: ['fundamentals'],
date: moment('2023-01-25')
},
{
title: 'What Does Setting the Length of a JavaScript Array Do?',
raw: './tutorials/fundamentals/set-length.md',
url: '/tutorials/fundamentals/array-set-length',
description: 'Here\'s what setting the length of a JavaScript array does.',
tags: ['fundamentals'],
date: moment('2023-01-23')
},
{
title: 'Make a Horizontal Bar Chart with ChartJS',
raw: './tutorials/chartjs/horizontal-bar-chart.md',
url: '/tutorials/chartjs/horizontal-bar-chart',
description: 'ChartJS bar charts are vertical by default. Here\'s how you make a horizontal bar chart.',
tags: ['chartjs'],
date: moment('2023-01-18')
},
{
title: 'Get the Last Element in an Array in JavaScript',
raw: './tutorials/fundamentals/get-last-element-array.md',
url: '/tutorials/fundamentals/get-last-element-array',
description: 'Here\'s 2 ways to get the last element in an array in JavaScript with no external dependencies.',
tags: ['fundamentals'],
date: moment('2023-01-06')
},
{
title: 'Lodash\'s cloneDeep() Function',
raw: './tutorials/lodash/clone-deep.md',
url: '/tutorials/lodash/clone-deep',
description: 'Here\'s how you use Lodash\'s cloneDeep function.',
tags: ['lodash'],
date: moment('2023-01-03')
},
{
title: 'Methods in Vue',
raw: './tutorials/vue/methods.md',
url: '/tutorials/vue/methods',
description: 'Here\'s what you need to know about methods in Vue',
tags: ['vue'],
date: moment('2022-12-20')
},
{
title: 'Use the Ternary Operator for Conditionals in Vue',
raw: './tutorials/vue/ternary-operator.md',
url: '/tutorials/vue/ternary-operator',
description: 'Here\'s what you need to know about using the ternary operator in Vue templates.',
tags: ['vue'],
date: moment('2022-12-01')
},
{
title: 'Skip an Index in JavaScript Array map()',
raw: './tutorials/fundamentals/map-skip-index.md',
url: '/tutorials/fundamentals/map-skip-index',
description: 'You can\'t skip an index using JavaScript\'s map() function, but there are a couple of workarounds. Here\'s 2 alternatives.',
tags: ['fundamentals'],
date: moment('2022-11-23')
},
{
title: 'Conditionally Add an Object to an Array in JavaScript',
raw: './tutorials/fundamentals/add-object-to-array-conditionally.md',
url: '/tutorials/fundamentals/add-object-to-array-conditionally',
description: 'Here\'s how you can conditionally add an object to an array, using push, concat, or the spread operator.',
tags: ['fundamentals'],
date: moment('2022-11-15')
},
{
title: 'Vue Email Validation',
raw: './tutorials/vue/email-validation.md',
url: '/tutorials/vue/email-validation',
description: 'Here\'s how you can validate an email input in Vue.',
tags: ['vue'],
date: moment('2022-11-08')
},
{
title: 'Validate Emails using Regex in JavaScript',
raw: './tutorials/fundamentals/email-regex.md',
url: '/tutorials/fundamentals/email-regex',
description: 'Here\'s a regular expression you can use to validate emails in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-10-27')
},
{
title: 'How to Copy Content to the Clipboard in Vue',
raw: './tutorials/vue/copy-clipboard.md',
url: '/tutorials/vue/copy-to-clipboard',
description: 'Here\'s how you can copy text to the clipboard programatically with Vue.',
tags: ['vue'],
date: moment('2022-10-19')
},
{
title: 'JavaScript Copy to Clipboard',
raw: './tutorials/fundamentals/copy-clipboard.md',
url: '/tutorials/fundamentals/copy-to-clipboard',
description: 'Here\'s how you can copy text to the clipboard programatically in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-10-17')
},
{
title: 'Creating Computed Properties with Vue\'s Composition API',
raw: './tutorials/vue/computed-properties-composition-api.md',
url: '/tutorials/vue/composition-computed',
description: 'Here\'s how you work can create computed properties using Vue 3\'s new composition API.',
tags: ['vue'],
date: moment('2022-10-10')
},
{
title: 'Toggle Visibility in Vue',
raw: './tutorials/vue/toggle-visibility.md',
url: '/tutorials/vue/toggle-visibility',
description: 'Here\'s 3 ways you can toggle an element\'s visibility in Vue templates.',
tags: ['vue'],
date: moment('2022-10-05')
},
{
title: 'Add Global Variables to Vue JS Templates',
raw: './tutorials/vue/global.md',
url: '/tutorials/vue/use-global-variable',
description: 'You can\'t access global variables from Vue templates by default, but here is how you can add variables that are global to all Vue templates.',
tags: ['vue'],
date: moment('2022-10-03')
},
{
title: 'Using bcrypt-js to Hash Passwords in JavaScript',
raw: './tutorials/node/bcrypt.md',
url: '/tutorials/node/bcrypt',
description: 'Here\'s how you can use bcrypt-js to work with passwords in Node.js.',
tags: ['node'],
date: moment('2022-09-30')
},
{
title: 'The inheritAttrs Option in Vue',
raw: './tutorials/vue/inherit-attribute.md',
url: '/tutorials/vue/inheritattrs',
description: 'Here\'s what you need to know about Vue components\' `inheritAttrs` option.',
tags: ['vue'],
date: moment('2022-09-26')
},
{
title: 'Props with Vue Router',
raw: './tutorials/vue/router-props.md',
url: '/tutorials/vue/router-props',
description: 'Here\'s how you pass custom props to your view components with Vue Router, including route parameters.',
tags: ['vue'],
date: moment('2022-09-23')
},
{
title: 'Working with the Node.js assert Library',
raw: './tutorials/node/assert.md',
url: '/tutorials/node/assert',
description: 'Here\'s what you need to know about Node\'s built-in assert module.',
tags: ['node'],
date: moment('2022-09-07')
},
{
title: 'Use HTML Files as Vue Templates with Webpack',
raw: './tutorials/vue/html-template.md',
url: '/tutorials/vue/html-template',
description: 'Here\'s how you can use Webpack to write your Vue templates as HTML files in the browser, as well as how to use HTML templates for server-side rendering in Node.js.',
tags: ['vue'],
date: moment('2022-08-31')
},
{
title: 'Using v-bind:src with Vue',
raw: './tutorials/vue/bind-src.md',
url: '/tutorials/vue/v-bind-src',
description: 'Here\'s how you can control an image\'s `src` property in Vue using `v-bind:src`.',
tags: ['vue'],
date: moment('2022-08-29')
},
{
title: 'Calculate the Median of an Array in JavaScript',
raw: './tutorials/fundamentals/calculate-median.md',
url: '/tutorials/fundamentals/median',
description: 'Here\'s how you can quickly calculate the median of an array of numbers in vanilla JavaScript, with no outside libraries.',
tags: ['fundamentals'],
date: moment('2022-08-24')
},
{
title: 'Format CSS in the Browser',
raw: './tutorials/tools/format-css.md',
url: '/tutorials/tools/format-css',
description: 'Here\'s an online tool for formatting CSS code in the browser, as well as how to implement CSS formatting in JavaScript yourself.',
tags: ['tools'],
date: moment('2022-08-22')
},
{
title: 'How to Remove Line Chart Fill in ChartJS',
raw: './tutorials/chartjs/remove-fill.md',
url: '/tutorials/chartjs/line-chart-fill-color',
description: 'Here\'s how you can configure ChartJS\' line chart fill color, including removing the fill color.',
tags: ['chartjs'],
date: moment('2022-08-18')
},
{
title: 'The encodeURIComponent() Function in JavaScript',
raw: './tutorials/fundamentals/encodeURIComponent.md',
url: '/tutorials/fundamentals/encodeuricomponent',
description: 'Here\'s how to use `encodeURIComponent()` to sanitize query string parameters in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-08-15')
},
{
title: 'Implementing Soft Delete in Mongoose',
raw: './tutorials/mongoose/soft-delete.md',
url: '/tutorials/mongoose/soft-delete',
description: 'Here\'s how you can implement soft delete with Mongoose.',
tags: ['mongoose'],
date: moment('2022-08-07')
},
{
title: 'Using limit() with Mongoose Queries',
raw: './tutorials/mongoose/limit.md',
url: '/tutorials/mongoose/limit',
description: 'Here\'s how you can use limit() to return a fixed number of documents with Mongoose `find()`.',
tags: ['mongoose'],
date: moment('2022-08-03')
},
{
title: 'Capitalize the First Letter of a String Using Lodash',
raw: './tutorials/lodash/capitalize-first-letter.md',
url: '/tutorials/lodash/capitalize-first-letter',
description: 'Here\'s how you capitalize the first letter of a string using Lodash.',
tags: ['lodash'],
date: moment('2022-07-30')
},
{
title: 'How to Check if a Date is Between Two Dates in JavaScript',
raw: './tutorials/fundamentals/check-date-between-two-dates.md',
url: '/tutorials/fundamentals/check-date-between-two-dates',
description: 'Here\'s how you can check if a date is between two dates in vanilla JavaScript, no libraries.',
tags: ['fundamentals'],
date: moment('2022-07-21')
},
{
title: 'Vue v-else-if',
raw: './tutorials/vue/v-else-if.md',
url: '/tutorials/vue/v-else-if',
description: 'Here\'s what you need to know about v-else-if in Vue.',
tags: ['vue'],
date: moment('2022-07-18')
},
{
title: 'Vue v-if and v-else',
raw: './tutorials/vue/v-if-and-else.md',
url: '/tutorials/vue/v-if-else',
description: 'Here\'s what you need to know about using `v-else` with `v-if` in Vue.',
tags: ['vue'],
date: moment('2022-07-13')
},
{
title: 'How to Fix "Buffering timed out after 10000ms" Error in Mongoose',
raw: './tutorials/mongoose/fix-buffering-timed-out.md',
url: '/tutorials/mongoose/buffering-timed-out-after-10000ms',
description: 'Here\'s what the "Buffering timed out after 10000ms" error means in Mongoose, and how to fix it.',
tags: ['mongoose'],
date: moment('2022-07-08')
},
{
title: 'Using insertOne() in Mongoose',
raw: './tutorials/mongoose/using-insertone-in-mongoose.md',
url: '/tutorials/mongoose/using-insertone-in-mongoose',
description: 'Mongoose models don\'t have an `insertOne()` function, but `create()` is similar. Here\'s what you need to know.',
tags: ['mongoose'],
date: moment('2022-07-05')
},
{
title: 'Check a String for Numbers in JavaScript',
raw: './tutorials/fundamentals/check-string-for-numbers.md',
url: '/tutorials/fundamentals/check-if-string-contains-numbers',
description: 'Here\'s how you can check if a string contains numbers in vanilla JavaScript.',
tags: ['fundamentals'],
date: moment('2022-06-27')
},
{
title: 'Remove null from an Array with Lodash',
raw: './tutorials/lodash/remove-null-from-array.md',
url: '/tutorials/lodash/remove-null-from-array',
description: 'Here\'s how you can remove null elements from an array with Lodash.',
tags: ['lodash'],
date: moment('2022-06-26')
},
{
title: 'Find Objects by Nested Properties with Lodash',
raw: './tutorials/lodash/find-nested-object.md',
url: '/tutorials/lodash/find-nested-object',
description: 'Here\'s how you can find an object in an array by a nested property using Lodash.',
tags: ['lodash'],
date: moment('2022-06-22')
},
{
title: 'Rename Variables When Using Object Destructuring in JavaScript',
raw: './tutorials/fundamentals/object-destructuring-rename.md',
url: '/tutorials/fundamentals/object-destructuring-rename',
description: 'Here\'s how you rename variables using destructuring assignment in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-06-17')
},
{
title: 'Split on Multiple Characters in JavaScript',
raw: './tutorials/fundamentals/split-on-multiple-characters.md',
url: '/tutorials/fundamentals/split-on-multiple-characters',
description: 'Here\'s how you can use the string `split()` method to split on one of multiple characters in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-06-13')
},
{
title: 'Using Lodash truncate',
raw: './tutorials/lodash/truncate.md',
url: '/tutorials/lodash/truncate',
description: 'Here\'s how you can use the `truncate()` function in Lodash to trim strings',
tags: ['lodash'],
date: moment('2022-06-10')
},
{
title: 'How to Remove a null from an Object with Lodash',
raw: './tutorials/lodash/remove-null-from-object.md',
url: '/tutorials/lodash/remove-null-from-object',
description: 'Here\'s how you can remove `null` properties from a JavaScript object using Lodash.',
tags: ['lodash'],
date: moment('2022-06-08')
},
{
title: 'Modify Authorized redirect_uris For Google OAuth',
raw: './tutorials/node/google-oauth-authorized-redirect-uris.md',
url: '/tutorials/node/google-oauth-authorized-redirect-uris',
description: 'Here\'s how to modify authorized redirect URIs for logging in with Google OAuth.',
tags: ['node'],
date: moment('2022-06-03')
},
{
title: 'Mongoose on(\'delete\')',
raw: './tutorials/mongoose/on-delete.md',
url: '/tutorials/mongoose/on-delete',
description: 'Here\'s two ways that Mongoose lets you execute code when a document is deleted: using middleware, and using change streams.',
tags: ['mongoose'],
date: moment('2022-05-31')
},
{
title: 'Enums in Mongoose',
raw: './tutorials/mongoose/enum.md',
url: '/tutorials/mongoose/enum',
description: 'Here\'s how you can use enum validators in Mongoose.',
tags: ['mongoose'],
date: moment('2022-05-23')
},
{
title: 'Fix "elements in interation expect to have \'v-bind:key\'" in Vue',
raw: './tutorials/vue/elements-in-iteration-expect-to-have-v-bind-key.md',
url: '/tutorials/vue/elements-in-iteration-expect-to-have-v-bind-key',
description: 'Here\'s how you can fix the `v-bind:key` warning in Vue.',
tags: ['vue'],
date: moment('2022-05-11')
},
{
title: 'Working with the img HTML Tag in Vue',
raw: './tutorials/vue/img.md',
url: '/tutorials/vue/img-tag',
description: 'Here\'s the basics of how to work with the `img` tag in Vue.',
tags: ['vue'],
date: moment('2022-05-09')
},
{
title: 'Empty Objects are Truthy in JavaScript?',
raw: './tutorials/fundamentals/empty-object-truthy.md',
url: '/tutorials/fundamentals/empty-object-truthy',
description: 'Empty objects are truthy in JavaScript, so you need a little extra work to check if an object is empty. Here\'s how.',
tags: ['fundamentals'],
date: moment('2022-05-05')
},
{
title: 'How to Merge Two Objects in JavaScript',
raw: './tutorials/fundamentals/merge-two-objects.md',
url: '/tutorials/fundamentals/merge-two-objects',
description: 'Here\'s two ways to merge two objects in vanilla JavaScript.',
tags: ['fundamentals'],
date: moment('2022-04-29')
},
{
title: 'Mongoose find() Certain Fields',
raw: './tutorials/mongoose/find-certain-fields.md',
url: '/tutorials/mongoose/find-certain-fields',
description: 'Here\'s how you can restrict Mongoose\'s `find()` function to only return certain fields using `select()`.',
tags: ['mongoose'],
date: moment('2022-04-27')
},
{
title: 'How to Fix \'Query was already executed\' in Mongoose',
raw: './tutorials/mongoose/query-was-already-executed.md',
url: '/tutorials/mongoose/query-was-already-executed',
description: 'Running into "Query was already executed" errors in Mongoose? Here\'s what causes this error, and how to fix it.',
tags: ['mongoose'],
date: moment('2022-04-21')
},
{
title: 'The firstChild Property in JavaScript',
raw: './tutorials/fundamentals/first-child.md',
url: '/tutorials/fundamentals/firstchild',
description: 'Here\'s what you need to know about the `firstChild` property in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-04-18')
},
{
title: 'The document.createElement Function in JavaScript',
raw: './tutorials/fundamentals/create-element.md',
url: '/tutorials/fundamentals/create-element',
description: 'The `createElement()` function lets you manually create DOM elements. Here\'s what you need to know.',
tags: ['fundamentals'],
date: moment('2022-04-15')
},
{
title: 'The difference() function in Lodash',
raw: './tutorials/lodash/difference.md',
url: '/tutorials/lodash/difference',
description: 'Here\'s how you can use the `difference()` function in Lodash to compute the values that are in one array but not another.',
tags: ['lodash'],
date: moment('2022-04-12')
},
{
title: 'Filter Duplicates with Lodash\'s uniq() Function',
raw: './tutorials/lodash/filter-duplicates.md',
url: '/tutorials/lodash/filter-duplicates',
description: 'Here\'s how you can use _.uniq() to filter out duplicate entries in a JavaScript array.',
tags: ['lodash'],
date: moment('2022-04-07')
},
{
title: 'Create a Chart with 2 Y Axes in ChartJS',
raw: './tutorials/chartjs/two-axes.md',
url: '/tutorials/chartjs/two-y-axes',
description: 'Here\'s how you can create a chart that has two different Y axes with different scales in ChartJS.',
tags: ['chartjs'],
date: moment('2022-04-04')
},
{
title: 'Retry Policies in Temporal',
raw: './tutorials/temporal/retry-policy.md',
url: '/tutorials/temporal/retry-policy',
description: 'Here\'s a tool that displays times between retries given different Temporal retry policies.',
tags: ['temporal'],
date: moment('2022-04-04')
},
{
title: 'Hide the Tooltip in ChartJS',
raw: './tutorials/chartjs/hide-tooltip.md',
url: '/tutorials/chartjs/hide-tooltip',
description: 'Here\'s how you can hide the default tooltip that shows when you mouse over a ChartJS chart.',
tags: ['chartjs'],
date: moment('2022-04-01')
},
{
title: 'Set Axis Label Color in ChartJS',
raw: './tutorials/chartjs/label-color.md',
url: '/tutorials/chartjs/axis-label-color',
description: 'Here\'s how you can configure the X and Y axis label colors in ChartJS.',
tags: ['chartjs'],
date: moment('2022-03-29')
},
{
title: 'Set Chart Size with ChartJS',
raw: './tutorials/chartjs/size.md',
url: '/tutorials/chartjs/size',
description: 'Setting the chart size with ChartJS is tricky. Here\'s what you need to know.',
tags: ['chartjs'],
date: moment('2022-03-25')
},
{
title: 'String replaceAll() in JavaScript',
raw: './tutorials/fundamentals/replaceAll.md',
url: '/tutorials/fundamentals/replaceall',
description: 'Here\'s how you can use replaceAll() to replace all instances of a substring in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-03-21')
},
{
title: 'Get A Character from a String in JavaScript',
raw: './tutorials/fundamentals/getChar.md',
url: '/tutorials/fundamentals/get-character-from-string',
description: 'Here\'s two ways to get the i-th character from a string in JavaScript, and which one you should use.',
tags: ['fundamentals'],
date: moment('2022-03-16')
},
{
title: 'Add to the Front of an Array in JavaScript',
raw: './tutorials/fundamentals/add-front.md',
url: '/tutorials/fundamentals/add-to-front',
description: 'Here\'s 3 ways you can add an element to the front of an array in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-03-10')
},
{
title: 'Array pop() in JavaScript',
raw: './tutorials/fundamentals/pop.md',
url: '/tutorials/fundamentals/pop',
description: 'Here\'s how the array method `pop()` works in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-03-08')
},
{
title: 'Array Unshift in JavaScript',
raw: './tutorials/fundamentals/unshift.md',
url: '/tutorials/fundamentals/unshift',
description: 'Here\'s how the array method `unshift()` works in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-03-04')
},
{
title: 'Array shift() in JavaScript',
raw: './tutorials/fundamentals/shift.md',
url: '/tutorials/fundamentals/shift',
description: 'Here\'s how the array method `shift()` works in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-03-01')
},
{
title: 'Shuffle an Array in JavasScript',
raw: './tutorials/fundamentals/shuffle.md',
url: '/tutorials/fundamentals/shuffle',
description: 'Here\'s how you can implement the Fisher-Yates Shuffle Algorithm in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-02-25')
},
{
title: 'The nextTick function in Vue',
raw: './tutorials/vue/nexttick.md',
url: '/tutorials/vue/nexttick',
description: 'Here\'s what you need to know about the `nextTick()` function in Vue, and why it is different from `setTimeout()`.',
tags: ['vue'],
date: moment('2022-02-23')
},
{
title: 'Convert JSON to YAML',
raw: './tutorials/tools/json-to-yaml.md',
url: '/tutorials/tools/json-to-yaml',
description: 'Convert JSON to YAML using this friendly in-browser converter.',
tags: ['tools'],
date: moment('2022-02-15')
},
{
title: 'Convert Binary to Decimal',
raw: './tutorials/tools/binary-to-decimal.md',
url: '/tutorials/tools/binary-to-decimal',
description: 'Convert binary numbers to decimal numbers with this handy tool.',
tags: ['tools'],
date: moment('2022-02-11')
},
{
title: 'Sleep in NodeJS',
raw: './tutorials/node/sleep.md',
url: '/tutorials/node/sleep',
description: 'Here\'s how you can delay operation executions in NodeJS.',
tags: ['node'],
date: moment('2022-02-08')
},
{
title: 'How to Use Mocks with Sinon',
raw: './tutorials/sinon/mock.md',
url: '/tutorials/sinon/mock',
description: 'Here\'s how mocks work in Sinon.js',
tags: ['sinon'],
date: moment('2022-02-04')
},
{
title: 'Spies in Sinon',
raw: './tutorials/sinon/spy.md',
url: '/tutorials/sinon/spy',
description: 'Here\'s how spies work in Sinon.js',
tags: ['sinon'],
date: moment('2022-02-01')
},
{
title: 'How to Stub a Function with Sinon',
raw: './tutorials/sinon/stub-function.md',
url: '/tutorials/sinon/stub-function',
description: 'Here\'s how you can use Sinon to stub a function.',
tags: ['sinon'],
date: moment('2022-01-28')
},
{
title: 'Vue.js Logos',
raw: './tutorials/vue/logos.md',
url: '/tutorials/vue/logo',
description: 'Download or link to the Vue.js logo in different styles and formats: svg, png, jpg.',
tags: ['vue'],
date: moment('2022-01-21')
},
{
title: 'How to Clear an Array in JavaScript',
raw: './tutorials/fundamentals/clear-array.md',
url: '/tutorials/fundamentals/clear-array',
description: 'Here\'s 3 ways to empty out an array in JavaScript, clearing out all the elements.',
tags: ['fundamentals'],
date: moment('2022-01-18')
},
{
title: 'How to Check if a Variable is an Integer in JavaScript',
raw: './tutorials/fundamentals/check-integer.md',
url: '/tutorials/fundamentals/is-integer',
description: 'Here\'s how you can check if a value is an integer in JavaScript.',
tags: ['fundamentals'],
date: moment('2022-01-13')
},
{
title: 'Handle POST Form Data with Express JS',
raw: './tutorials/express/post-form.md',
url: '/tutorials/express/post-form',
description: 'Here\'s how you can handle HTTP FormData with Express',
tags: ['express'],
date: moment('2022-01-10')
},
{
title: 'Check What Arguments a Sinon Stub Was Called With',
raw: './tutorials/sinon/check-arguments.md',
url: '/tutorials/sinon/stub-called-with',
description: 'Here\'s two ways to check whether a SinonJS stub was called with given arguments.',
tags: ['sinon'],
date: moment('2022-01-05')
},
{
title: 'How to Use the Sinon stub() Function',
raw: './tutorials/sinon/stub.md',
url: '/tutorials/sinon/stub',
description: 'Here\'s how you can use `sinon.stub()` to stub out functions and assert that they were called.',
tags: ['sinon'],
date: moment('2022-01-03')
},
{
title: 'How to Check Whether a String Does Not Start With a Regex in JavaScript',
raw: './tutorials/fundamentals/regex-no-start.md',
url: '/tutorials/fundamentals/regex-not-starting-with',
description: 'Here\'s how you can check whether a string does *not* start with a given regular expression in JavaScript.',
tags: ['fundamentals'],
date: moment('2021-12-29')
},
{
title: 'Check Whether a String Starts with a Regexp in JavaScript',
raw: './tutorials/fundamentals/regexp-starts-with.md',
url: '/tutorials/fundamentals/regexp-starts-with',
description: 'Here\'s how you can use the RegExp `test()` function to test whether a string starts with a regular expression.',
tags: ['fundamentals'],
date: moment('2021-12-24')
},
{
title: 'What Does `app.use(express.json())` Do in Express?',
raw: './tutorials/express/express-json.md',
url: '/tutorials/express/express-json',
description: 'Confused by `app.use(express.json())` in Express? Here\'s what you need to know.',
tags: ['express'],
date: moment('2021-12-20')
},
{
title: 'Format a JavaScript Date to YYYY MM DD',
raw: './tutorials/fundamentals/YMD.md',
url: '/tutorials/fundamentals/date-tostring-format-yyyy-mm-dd',
description: 'Looking to format a JavaScript date to YYYY-MM-DD? Here\'s two easy ways using vanilla JavaScript.',
tags: ['fundamentals'],
date: moment('2021-12-10')
},
{
title: 'Array toString() in JavaScript',
raw: './tutorials/fundamentals/array-toString.md',
url: '/tutorials/fundamentals/array-tostring',
description: 'Looking to convert an array to a string in JavaScript? Here\'s two ways.',
tags: ['fundamentals'],
date: moment('2021-12-08')
},
{
title: 'How to Parse URL in JavaScript into Host, Path, Search, and Hash',
raw: './tutorials/fundamentals/parse-url.md',
url: '/tutorials/fundamentals/parse-url',
description: 'Here\'s how you can parse a URL into components in vanilla JavaScript.',
tags: ['fundamentals'],
date: moment('2021-12-03')
},
{
title: 'How to Reverse an Array in JavaScript',
raw: './tutorials/fundamentals/reverse-array.md',
url: '/tutorials/fundamentals/reverse-array',
description: 'Here\'s how you can reverse an array in JavaScript, both in-place and without mutating the original array.',
tags: ['fundamentals'],
date: moment('2021-11-30')
},
{
title: 'How to Check if a Property is Undefined in JavaScript',
raw: './tutorials/fundamentals/property-undefined.md',
url: '/tutorials/fundamentals/check-if-property-is-undefined',
description: 'Checking if a property is undefined in JavaScript is easy, but has some nuances. Here\'s what you need to know 👉',
tags: ['fundamentals'],
date: moment('2021-11-24')
},
{
title: 'How to Delete By Id in Mongoose',
raw: './tutorials/mongoose/deleteById.md',
url: '/tutorials/mongoose/delete-by-id',
description: 'Mongoose doesn\'t have a `deleteById()` function, but here\'s how you can delete an object by its _id 👉',
tags: ['mongoose'],
date: moment('2021-11-19')
},
{
title: 'How to Compare an Array of Numbers in JavaScript',
raw: './tutorials/fundamentals/compare-array-numbers.md',
url: '/tutorials/fundamentals/compare-array-of-numbers',
description: 'Here\'s how you can compare 2 arrays of numbers in vanilla JavaScript.',
tags: ['fundamentals'],
date: moment('2021-11-16')
},
{
title: 'How to Remove the Last Character from a String in JavaScript',
raw: './tutorials/fundamentals/remove-last-char.md',
url: '/tutorials/fundamentals/remove-last-character',
description: 'Need to remove the last character from a string in JavaScript? Here\'s 3 ways 👉',
tags: ['fundamentals'],
date: moment('2021-11-12')
},
{
title: 'The deleteMany() Function in Mongoose',
raw: './tutorials/mongoose/deleteMany.md',
url: '/tutorials/mongoose/deletemany',
description: 'Mongoose models have an `deleteMany()` function that allows deleting all documents that match a filter. Here\'s what you need to know.',
tags: ['mongoose'],
date: moment('2021-11-05')
},
{
title: 'How to Use Mongoose\'s updateMany() Function',
raw: './tutorials/mongoose/updateMany.md',
url: '/tutorials/mongoose/updatemany',
description: 'Mongoose models have an `updateMany()` function that allows updating all documents that match a filter. Here\'s what you need to know.',
tags: ['mongoose'],
date: moment('2021-11-02')
},
{
title: 'Defining Plugins with Webpack',
raw: './tutorials/webpack/define-plugin.md',
url: '/tutorials/webpack/define-plugin',
description: 'All about Webpack\'s `definePlugin()` function: how it works, and when to use it.',
tags: ['webpack'],
date: moment('2021-10-29')
},
{