JavaScript questions.


001

JavaScript - characteristics:
 - multi-paradigm, dynamically and weakly typed language
 - these type of operations are possible: 1 + "2" (weakly typed)

Other JS paradigms:
 * Procedural (Imperative), OOP, Functional, Event-driven


002

How to embed JS code to html? Odpowiedź
 - there are few options to embed JS code into html/DOM document with script tag
 - other options, not using script tag exist, but these are considered as "alternative"
JavaScript script tag asynchronous modes:
 - defer/async, different behaviour
 - But by default when none of defer/async is used then JS script will be executed synchronous way.
   Blocking script (in context of DOM building).
 - Also, type="module" causes deferred-like execution: <script type="module">

Titbit - document.write behaviour:
 - It is important to know that document.write can behave unpredictably when used inappropriately.
 - For example when we use defer/async we cant be sure that code will be executed (browser decides and can ignore this code).
 - And finally 'document.write' is old-fashioned and not recommended to use. There are alternatives.



003

Ranges/Namespaces in JavaScript.
  - global, local function-like, block-like


004

Global context in JavaScript.
  - window object, Window function, globalThis alias
  - Web browser vs other environments (Node.js)


005

Typy w JavaScript: prymitywne i referencyjne (nie wszystko jest obiektem tutaj - w Pythonie wszystko).

Typy prymitywne (Typy proste = prymitywy)
Charakterystyka/rodzaje:
   s1 = "Text ....."; // prymityw
   s2 = String("Text ....."); // prymityw
   s3 = new String("Text ....."); // obiekt typu String, nie prymityw

 - Nie mają prototypu, nie dziedziczą po Object, jest ich 7.
 - Prymitywy nie są obiektami, i nie mają właściwości ani metod.
 - undefined, symbol, bigint, number, string, null, boolean
 - W JavaScript przypisanie prymitywu to zawsze kopiowanie wartości, nie referencji.

 - W pewnych sytuacjach, np kiedy próbujemy wywołać metody na prymitywnych typach (np. toUpperCase() na stringu),
   JS tymczasowo "opakowuje" te wartości w odpowiednie nowe obiekty - tj. autoboxing.
   Nie wszystkie typy posiadają obiektowe wersje: String, Number, Boolean, Symbol posiadają.

   Autoboxing flow: "abc".toUpperCase();
       new String("abc");
       toUpperCase();
       delete temp String object
       return "ABC"

Typy referencyjne (obiekty):
 - Object jest podstawowym typem referencyjnym.
 - Object, Array, Function, Date, Map itp.
 - Typy obiektowe są przekazywane przez referencję.
 - Każdy obiekt w JS ma tzw. prototyp — obiekt, z którego dziedziczy właściwości i metody.


006, 007

 - Styl-konwencje, camelCase, PascalCase, snake_case, UPPERCASE - co i kiedy się używa w JavaScript?
 - Jaka jest różnica między == i === w JavaScript? Kiedy co stosować?


008

Functions.
  - classic vs arrow-like functions








Scripts inside html:

Number Place Description
------ ------ ------
------ ------ ------




Run CORS-accepting http server!!!







Examples of informative buttons:

🔔

Click OK to get more information.

Examples of inputs:










- -