Skip to content

28th March 2022

Coding

  • New: Sum up the VueJS tutorial.

Javascript

  • New: Use ternary conditional operator.

    It's defined by a condition followed by a question mark ?, then an expression to execute if the condition is truthy followed by a colon :, and finally the expression to execute if the condition is falsy.

    condition ? exprIfTrue : exprIfFalse

    function getFee(isMember) {
      return (isMember ? '$2.00' : '$10.00');
    }
    
    console.log(getFee(true));
    // expected output: "$2.00"
    
    console.log(getFee(false));
    // expected output: "$10.00"
    
    console.log(getFee(null));
    // expected output: "$10.00"
    
  • New: Filter the contents of an array.

    The filter() method creates a new array filled with elements that pass a test provided by a function.

    The filter() method does not execute the function for empty elements.

    The filter() method does not change the original array.

    For example:

    const ages = [32, 33, 16, 40];
    const result = ages.filter(checkAdult);
    
    function checkAdult(age) {
      return age >= 18;
    }
    
  • New: Interacting with HTML.

Arts

Book Binding

  • New: Introduce book binding.

    Book binding is the process of physically assembling a book of codex format from an ordered stack of paper sheets that are folded together into sections called signatures or sometimes left as a stack of individual sheets. Several signatures are then bound together along one edge with a thick needle and sturdy thread.