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

Karteikarten

3. Language Basics

Ioana Cosmina JavaScript Englisch 31 Karten

Karten in diesem Stapel (31)

  1. 1Strict mode "use strict";Different parsing and execution model for JS, where some erratic behavior of ECMAScript 3 is addressed and errors are thrown for unsafe activities.
  2. 2What is a variable?A named placeholder for a value, can hold any type of data (loosely typed)
  3. 3The var operatorDefines a variable making it local to the scope in which it was defined.
  4. 4How can you define a variable globally?By omitting the var operator. Bad practice!
  5. 5What are the primitive data types? (7)Boolean
    Null
    Undefined
    Number
    BigInt
    String
    Symbol
    BUNS BNS
  6. 6Which is the complex data type?Object
  7. 7typeof operatorUsed to determine the data type of a given variable.
  8. 8typeof null returns?"object"
  9. 9When does "typeof" return undefined?When called on an uninitialized variable
    When called on an undeclared variable
  10. 10The null typeIs an empty object pointer.
  11. 11var car = null; alert(typeof car); returns?"object" - null is an empty object pointer
  12. 12When should you use null?Anytime an object is expected, but not available, null should be used.
  13. 13The Boolean typeHas two values: true and false (case-sensitive)
  14. 14Boolean()Converts a value into its Boolean equivalent.
  15. 15Which values are converted to "true" when calling Boolean() ?true
    nonempty strings
    nonzero numbers
    infinity
    objects
  16. 16Which values are converted to "false" when calling Boolean() ?false
    " " empty strings
    0, NaN
    null
    undefined
  17. 17The Number typeThe number type represents both integer and floating point numbers.
  18. 18What is NaN?A special numeric value used to indicate when an operation intended to return a number has failed.
    Ex: diving a number by 0
  19. 19isNaN()Determines if the value is "not a number".
    Any value that cannot be converted to a number returns "true".
  20. 20alert(NaN == Nan); returns?false - NaN is not equal to any value
  21. 21Which are the 3 functions you can use to convert nonnumeric values into numbers?Number()
    parseInt()
    parseFloat()
  22. 22The String typeA sequence of zero or more 16-bit Unicode characters, delineated by quotes.
  23. 23Are strings mutable?Strings are immutable, once they are created their values cannot change.
  24. 24How do you change the string held by a variable?var lang = "Java";
    lang = lang + "Script";
  25. 25What methods can convert a value to a string?toString()
    String()
  26. 26The Object typeCreated by using the new operator
    var o = new Object();
  27. 27Properties and methods of Object instances (7)constructor
    hasOwnProperty(propName)
    isPrototypeOf(object)
    propertyIsEnumerable(propName)
    toLocaleString()
    toString()
    valueOf()
  28. 28flow control statementsif
    while & do-while
    for & for-in
    label
    break & continue
    with
    switch
  29. 29function syntaxfunction funcName(arg0, arg1, ..., argN) {
    statements
    }
  30. 30What does return do?Stops the function from further executing, exists immediately and returns a value (specified or undefined)
  31. 31Is there Overloading in JS?No, if two functions are defined with the same name, it is the last function that becomes the owner of that name.

Informationen

Beschreibung
JavaScript Karteikarten am 3. Language Basics, erstellt von Ioana Cosmina am 24/01/2020.
Erstellt von
Ioana Cosmina
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck