Scripts

Javascript

JavaScript Guide https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide Comments // a one line comment /* this is a longer, * multi-line comment */ Declarations # Declare variable, optionally initialize it to a value var a = 1; # Declares a block-scoped, local variable, optionally initializing it to a value. let b = 2; # Declares a block-scoped, read-only named constant. const c = 3; A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($).

Bash for loop

Source https://linuxize.com/post/bash-for-loop/ for loop for item in [LIST] do [COMMANDS] done loop overstrings for element in Hydrogen Helium Lithium Beryllium do echo "Element: $element" done loop over a number range for i in {0..3} do echo "Number: $i" done loop over number range and increment by 5 for i in {0..20..5} do echo "Number: $i" done loop over array elements BOOKS=('In Search of Lost Time' 'Don Quixote' 'Ulysses' 'The Great Gatsby') for book in "${BOOKS[@]}"; do echo "Book: $book" done The C-style Bash for loop for ((i = 0 ; i <= 1000 ; i++)); do echo "Counter: $i" done break and continue Statements for element in Hydrogen Helium Lithium Beryllium; do if [[ "$element" == 'Lithium' ]]; then break fi echo "Element: $element" done echo 'All Done!

Bash

Source https://linuxize.com/post/bash-for-loop/ Bash BASH for loop BASH while loop sha256: 1c5a97339ecb3835b5262ed063593b0cc61047fe118454cc0e41ff2a2a9b816a