#javascript #webdev
Dlaczego:
var a = "string";
console.log("length" in a);
Zwraca error
var a = new String("string");
Dlaczego:
var a = "string";
console.log("length" in a);
Zwraca error
var a = new String("string");
Wszystko
Najnowsze
Archiwum
JavaScript automatically converts primitives to String objects , so that it's possible to use String object methods for primitive strings.
so that it's possible to use String object methods for primitive strings.
in to operator. Metoda to np. .charAt()Write a range function that takes two arguments, start and end, and returns an array containing all the numbers from start up to (and including) end.
Next, write a sum function that takes an array of numbers and returns the sum of these numbers. Run the previous program and see whether it does indeed
Array.prototype bo sumę można zrobić dużo czytelniej: return arrayOfNumbers.reduce((result, item) => result + item)
:focus-ring , która pozwala na stylowanie elementów które mają focus, ale tylko tych, które przeglądarka uważa za godne niebieskiego outline-a(np `, ale już nie `). Pozwala to na usunięcie niechcianego outline-a dla większości użytkowników, a zostawienie go w spokoju dla kogoś kto używa np klawiatury podczas poruszania się po stronie. Dodatkowo koleś pokazuje 2 polyfill-e to uzyskania podobnego efektu już dziś:Node.js
źródło: comment_nHU7vkBuMid0f2dnBBOmNFz9jKElRgke.jpg
PobierzfrontAPI.getProduct(function (product) {
console.log(product);Regulamin
Reklama
Kontakt
O nas
FAQ
Osiągnięcia
Ranking
szukam jakiejś biblioteki do manipulacji czasem w #js (dodawanie sekund, porównywanie czasu, odejmowanie/dodwanie czasu) bez daty. Polecicie coś ? Moment nie bardzo się sprawdza.