Preskoči na sadržaj
Korištenjem servisa na Twitteru pristajete na korištenje kolačića. Twitter i partneri rade globalno te koriste kolačiće za analize, personalizaciju i oglase.

Za najbolje sučelje na Twitteru koristite Microsoft Edge ili instalirajte aplikaciju Twitter iz trgovine Microsoft Store.

  • Naslovnica Naslovnica Naslovnica, trenutna stranica.
  • O Twitteru

Spremljena pretraživanja

  • obriši
  • U ovom razgovoru
    Ovjeren akauntZaštićeni tweetovi @
Predloženi korisnici
  • Ovjeren akauntZaštićeni tweetovi @
  • Ovjeren akauntZaštićeni tweetovi @
  • Jezik: Hrvatski
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English
    • English UK
    • Español
    • Filipino
    • Français
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Български език
    • Русский
    • Српски
    • Українська мова
    • Ελληνικά
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Imate račun? Prijava
    Imate račun?
    · Zaboravili ste lozinku?

    Novi ste na Twitteru?
    Registrirajte se
Profil korisnika/ce jaffathecake
Jake Archibald
Jake Archibald
Jake Archibald
@jaffathecake

Tweets

Jake Archibald

@jaffathecake

Googler. Once swam to the end of an infinity pool. No thought goes unpublished. 'IMO' implicit.

Haywards Heath
jakearchibald.com
Vrijeme pridruživanja: srpanj 2008.

Tweets

  • © 2020 Twitter
  • O Twitteru
  • Centar za pomoć
  • Uvjeti
  • Pravila o privatnosti
  • Imprint
  • Kolačići
  • Informacije o oglasima
Odbaci
Prethodni
Sljedeće

Idite na profil osobe

Spremljena pretraživanja

  • obriši
  • U ovom razgovoru
    Ovjeren akauntZaštićeni tweetovi @
Predloženi korisnici
  • Ovjeren akauntZaštićeni tweetovi @
  • Ovjeren akauntZaštićeni tweetovi @

Odjava

Blokiraj

  • Objavi Tweet s lokacijom

    U tweetove putem weba ili aplikacija drugih proizvođača možete dodati podatke o lokaciji, kao što su grad ili točna lokacija. Povijest lokacija tweetova uvijek možete izbrisati. Saznajte više

    Vaši popisi

    Izradi novi popis


    Manje od 100 znakova, neobavezno

    Privatnost

    Kopiraj vezu u tweet

    Ugradi ovaj Tweet

    Embed this Video

    Dodajte ovaj Tweet na svoje web-mjesto kopiranjem koda u nastavku. Saznajte više

    Dodajte ovaj videozapis na svoje web-mjesto kopiranjem koda u nastavku. Saznajte više

    Hm, došlo je do problema prilikom povezivanja s poslužiteljem.

    Integracijom Twitterova sadržaja u svoje web-mjesto ili aplikaciju prihvaćate Twitterov Ugovor za programere i Pravila za programere.

    Pregled

    Razlog prikaza oglasa

    Prijavi se na Twitter

    · Zaboravili ste lozinku?
    Nemate račun? Registrirajte se »

    Prijavite se na Twitter

    Niste na Twitteru? Registrirajte se, uključite se u stvari koje vas zanimaju, i dobivajte promjene čim se dogode.

    Registrirajte se
    Imate račun? Prijava »

    Dvosmjerni (slanje i primanje) kratki kodovi:

    Država Kod Samo za korisnike
    Sjedinjene Američke Države 40404 (bilo koje)
    Kanada 21212 (bilo koje)
    Ujedinjeno Kraljevstvo 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Irska 51210 Vodafone, O2
    Indija 53000 Bharti Airtel, Videocon, Reliance
    Indonezija 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italija 4880804 Wind
    3424486444 Vodafone
    » Pogledajte SMS kratke šifre za druge zemlje

    Potvrda

     

    Dobro došli kući!

    Vremenska crta mjesto je na kojem ćete provesti najviše vremena i bez odgode dobivati novosti o svemu što vam je važno.

    Tweetovi vam ne valjaju?

    Prijeđite pokazivačem preko slike profila pa kliknite gumb Pratim da biste prestali pratiti neki račun.

    Kažite mnogo uz malo riječi

    Kada vidite Tweet koji volite, dodirnite srce – to osobi koja ga je napisala daje do znanja da vam se sviđa.

    Proširite glas

    Najbolji je način da podijelite nečiji Tweet s osobama koje vas prate prosljeđivanje. Dodirnite ikonu da biste smjesta poslali.

    Pridruži se razgovoru

    Pomoću odgovora dodajte sve što mislite o nekom tweetu. Pronađite temu koja vam je važna i uključite se.

    Saznajte najnovije vijesti

    Bez odgode pogledajte o čemu ljudi razgovaraju.

    Pratite više onoga što vam se sviđa

    Pratite više računa da biste dobivali novosti o temama do kojih vam je stalo.

    Saznajte što se događa

    Bez odgode pogledajte najnovije razgovore o bilo kojoj temi.

    Ne propustite nijedan aktualni događaj

    Bez odgode pratite kako se razvijaju događaji koje pratite.

    Jake Archibald‏ @jaffathecake 3. sij
    • Prijavi Tweet

    All code using array.reduce should be rewritten without array.reduce so it's readable by humans *mutes thread*

    04:40 - 3. sij 2020.
    • 254 proslijeđena tweeta
    • 1.796 oznaka „sviđa mi se”
    • Amine Bouyarmane Sudhanshu Yadav リッフィー レー John Davis Marc Reichelt Kirill Shestakov Bartosz Cytrowski Yahya Bayramoglu Jose Luis Faker
    175 replies 254 proslijeđena tweeta 1.796 korisnika označava da im se sviđa
      1. Novi razgovor
      2. Jake Archibald‏ @jaffathecake 3. sij
        • Prijavi Tweet

        Ok ok, fair enough, there are cases where array.reduce is the best thing to use. Specifically, cases where you want to look really smart and don't care about readability.

        11 replies 40 proslijeđenih tweetova 440 korisnika označava da im se sviđa
        Prikaži ovu nit
      3. Jake Archibald‏ @jaffathecake 3. sij
        • Prijavi Tweet

        I mean, wtf:pic.twitter.com/YTVouqkURX

        Messy array.reduce code example from https://developers.google.com/web/fundamentals/primers/promises
        37 replies 4 proslijeđena tweeta 188 korisnika označava da im se sviđa
        Prikaži ovu nit
      4. Jake Archibald‏ @jaffathecake 3. sij
        • Prijavi Tweet

        waitpic.twitter.com/xouE33giPs

        …authored by me
        6 replies 5 proslijeđenih tweetova 154 korisnika označavaju da im se sviđa
        Prikaži ovu nit
      5. Jake Archibald‏ @jaffathecake 3. sij
        • Prijavi Tweet

        (although, in my defence https://developers.google.com/web/fundamentals/primers/async-functions#example_outputting_fetches_in_order …)

        4 proslijeđena tweeta 66 korisnika označava da im se sviđa
        Prikaži ovu nit
      6. Jake Archibald‏ @jaffathecake 3. sij
        • Prijavi Tweet

        Whoa, this is worse than that time I pissed off Trump supporters

        10 replies 3 proslijeđena tweeta 130 korisnika označava da im se sviđa
        Prikaži ovu nit
      7. Jake Archibald‏ @jaffathecake 4. sij
        • Prijavi Tweet

        Here's a great quote from the inventor of Python (h/t @tigt_): "the applicability of reduce() is pretty much limited to associative operators, and in all other cases it's better to write out the accumulation loop explicitly" https://www.artima.com/weblogs/viewpost.jsp?thread=98196 …

        5 proslijeđenih tweetova 69 korisnika označava da im se sviđa
        Prikaži ovu nit
      8. Jake Archibald‏ @jaffathecake 4. sij
        • Prijavi Tweet

        BUT, on the other hand, Jimmy-randbro tells me I'm too dumb to appreciate the majesty of reduce, so WHO KNOWS.

        7 replies 2 proslijeđena tweeta 50 korisnika označava da im se sviđa
        Prikaži ovu nit
      9. Jake Archibald‏ @jaffathecake 4. sij
        • Prijavi Tweet

        Ok, I've been asking folks for good examples of reduce, and they fall into a few categories. Here's what I've seen: SUMS! Yes, this is the textbook example, and one of the few ok uses of reduce. The reduce example is probably better here.pic.twitter.com/Be5mCAlTBQ

        const arr = [1, 2, 3];

// Reduce:
arr.reduce((total, item) => total + item);

// Not reduce:
let total = 0;
for (const item of arr) total += item;
        9 replies 10 proslijeđenih tweetova 74 korisnika označavaju da im se sviđa
        Prikaži ovu nit
      10. Jake Archibald‏ @jaffathecake 4. sij
        • Prijavi Tweet

        Folks suggested other forms of 'gathering', such as concatenating the keys of an object. In this case I think the map + join is more expressive. However, I'd go for the loop if the two iterations caused performance issues (which is unlikely).pic.twitter.com/P1okn7edIG

        const arr = [
  {foo: 'hello'},
  {foo: 'world'},
];
// Should become "helloworld"

// Reduce:
arr.reduce((str, item) => str += item, '');

// Not reduce:
arr.map(item => item.foo).join('');

// Loop:
let str = '';
for (const item of arr) str += item.foo;
        2 proslijeđena tweeta 38 korisnika označava da im se sviđa
        Prikaži ovu nit
      11. Jake Archibald‏ @jaffathecake 4. sij
        • Prijavi Tweet

        Another interesting example was "getting the size of the largest string". Again, I find the map + max version better describes the intent. "Is the length of the first item bigger than the biggest item so far? If so, remember it" vs "Get all the lengths, give me the biggest"pic.twitter.com/97230D4EF2

        const arr = ['one', 'two', 'three'];
// Should be 5

// Reduce:
arr.reduce((largest, item) => Math.max(largest, item.length), 0);

// Not reduce:
Math.max(...arr.map(item => item.length));
        5 replies 3 proslijeđena tweeta 48 korisnika označava da im se sviđa
        Prikaži ovu nit
      12. Jake Archibald‏ @jaffathecake 4. sij
        • Prijavi Tweet

        Most suggestions were object transformations. I strongly believe these should not use reduce. Most were creating the object once, then passing the same object back through reduce. This is using reduce for decoration only. The only part of reduce it's using is the looping.pic.twitter.com/2HLSXxg3gO

        // Array to object keys
const arr = ['hello', 'world'];
// Should become {hello: null, world: null}

// Reduce:
const obj = arr.reduce((obj, item) => {
  obj[item] = null;
  return obj;
}, {});

// Map + fromEntries:
const obj = Object.fromEntries(
  arr.map(item => [item, null]),
);

// Loop:
const obj = {};
for (const item of arr) obj[item] = null;
        10 replies 9 proslijeđenih tweetova 96 korisnika označava da im se sviđa
        Prikaži ovu nit
      13. Jake Archibald‏ @jaffathecake 4. sij
        • Prijavi Tweet

        I saw ones similar to the above, but the author had realised the reduce was being used for decoration. So to avoid that, they create a new object on each iteration. This is not only obfuscated, it's O(n2) slow. It might make you look smart to other developers though! 😀pic.twitter.com/w0mnNNvJdf

        const obj = arr.reduce((obj, item) => ({
  ...obj,
  [item]: null,
}), {});
        17 replies 5 proslijeđenih tweetova 78 korisnika označava da im se sviđa
        Prikaži ovu nit
      14. Kraj razgovora

    Čini se da učitavanje traje već neko vrijeme.

    Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.

      Sponzorirani tweet

      false

      • © 2020 Twitter
      • O Twitteru
      • Centar za pomoć
      • Uvjeti
      • Pravila o privatnosti
      • Imprint
      • Kolačići
      • Informacije o oglasima