GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Flussdiagramm

Strings data type overview

Kostas Diakogiannis Web Developing Junior Certificate Englisch

Inhalt des Flussdiagramms

  1. JavaScript String Type

  2. Strings Data Type

    Dealing with text. Is a symbol of characters united together to display a unified message that is readable not only from computers but also from users.

    You create a string with 2 possible ways and the difference is on the quotes:

    let sentence = 'This is a string literal' // This is called a string literal

    let anotherSentence = `This is an interpolated string` // string interpolation

    The main difference is that interpolated strings can contain javascript expressions inside (like variables, executable functions and many many more), while in order to achieve the same result with string literals you need to concatenate the expressions to the existing string.

    ex. let name = 'Jake';

    let sayYourName = 'Hello, my name is ' + name;

    let sayYourNameInterpolated = `Hello, my name is ${name}`

    Strings have methods in order to be manipulated and changes. Some of the most used ones are:

    string.length // Returns the exact length of the specified string

    string.split(' ') // Splits an existing string into array elements. You can specify every when is splited

    string[0] // Grab the first character of a string. Or grab in general by index.

    string. replace('someword', 'anotherword') // Replace all instances of the first argument with the second

    You can find out whole String documentation here!

Informationen

Beschreibung
Junior Certificate Web Developing (JavaScript) Flussdiagramm am Strings data type overview, erstellt von Kostas Diakogiannis am 12/10/2018.
Aufrufe
9
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck