Javascript

Subdecks (1)

Cards (26)

  • Erstelle eine Regex Variable, die den Buchstaben "e" herausfiltert
    const regex = /e/;
  • Welche Regex flag sucht nach Groß- und Kleinschreibung? Gib in Klammern, den ausgeschriebenen Namen des flags an.
    i (insensitive)
  • Man kann in regex expressions einen Ziffernbereich angeben, in dem man z.B. [0-9] schreibt.
  • The + modifier in a regex allows you to match a pattern that occurs one or more times.
  • There is a shorthand character class to match any digit: \d.
  • Strings have a.match()method, which takes a regex argument. .match() will return an array of match results – containing either the first match, or all matches if the global flag is used in the regex.
  • null in JavaScript is a special primitive that represents the intentional absence of a value. In a boolean context, null is considered falsy which evaluates to false in a conditional statement.
  • concatenation is the process of joining two or more strings together to form a single string. It uses "+" for joining two strings.
  • properties are always written behind the associated string or variable, and are always written in lowercase.
  • Non primitive data types are mutable data types that are not undefined, null, boolean, number, string, or symbol. Mutable means that the data can be changed after it is created.
  • Template literals are denoted with backticks ``.
  • Variables can be passed in to a template literal by surrounding the variable with ${} – the value of the variable will be inserted into the string.
  • JavaScript has a feature called template literals, which allow you to interpolate variables directly within a string
  • You can check if a value is truthy or falsy by passing it into an if-statement, without any operators.
  • A ternary operator is a conditional operator in JavaScript that evaluates a conditional expression and returns either a truthy or falsy value.
  • Variable naming follows specific rules: names can include letters, numbers, dollar signs, and underscores, but cannot contain spaces and must not begin with a number.
  • Assigning a value to a variable at the moment of its declaration is known asinitialization.
  • Strings areimmutable, which means once they are created, they cannot be changed.
  • Non-primitive data types differ from primitive data types in that they can hold more complex data. Primitive data types like strings and numbers can only hold one value at a time.