¡GoConqr estrena diseño! Cuéntanos qué te parece.

Fichas

Javascript basics 2

James Drummond Javascript A-Level Inglés 10 fichas

Fichas del conjunto (10)

  1. 1How do you test something against a regex?var str = 'mystring';
    /[^a-zA-Z0-9]/.test( str );
    // Tests if string is alphanumeric
  2. 2How do you test a string against a regex?var str = 'mystring';
    str.match(/[^a-zA-Z0-9]/);
    // Tests if string is alphanumeric
  3. 3How do you convert a string to lower case?var str = 'This Is A StrinG';
    var lowerCase = str.toLowerCase();
  4. 4How do you trim whitespace from a string?var trimmedString = ' This is a string with whitespace '.trim();
  5. 5How do you iterate over an object in Javascript?for (var prop in obj){
    }
  6. 6Is the order of the keys in an ordinary object guaranteed?No
  7. 7How do you test if something is a function?if (typeof obj === 'function')
  8. 8What is the best way to round a number to two decimal placesMath.round(value*100)/100
    - works better than toFixed()
  9. 9var a = { name : 'james' } var b = a; b.name = 'Anna' What is a.name?a.name is Anna. Javascript assignment is by reference: both variables point to the same object.
  10. 10How do you copy an object in ES6?var b = Object.assign({}, b)

Información

Descripción
A-Level Javascript Fichas sobre Javascript basics 2, creado por James Drummond el 18/12/2015.
Creado por
James Drummond
Visitas
2
Etiquetas
javascript
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?