Rezultati pretraživanja
  1. 20. velj 2009.

    Looking to make your form checkboxes match your overall design more closely? Give FancyForm a look. http://lipidity.com/fancy-form/

  2. 30. pro 2018.

    How to use async/await without try/catch block: const to = p => p.then(r => [null, r]).catch(e => [e]) Usage: async function func () { const [err, result] = await to(promiseFunction()) if (err) { return null } // do something here with result =) }

    Prikaži ovu nit
  3. 14. lis 2010.

    If you redeclare a JavaScript variable, it will not lose its original value as long you doesn't assign a new value

  4. 3. stu 2019.

    Get a list of all CSS classes used in a page (useful when eliminating unused CSS code) by pasting this in the console: [...new Set($$("[class]").flatMap(e => [...e.classList]))]

    Prikaži ovu nit
  5. 7. srp 2019.

    vue-router/meteorjs quick tip: don't use Meteor.user() in router guards. the user object isn't available as long as the universal publication isn't ready.

  6. JavaScript tip: Use === instead of ==. == only checks if the value is the same while === checks if has the same type and value Eg 10==‘10’ //true 10===‘10’ //false

  7. 30. lip 2018.

    So many ways to round numbers in JavaScript. Reply with any methods I may have forgotten! 🔥 🔥

    /* 🔥 #jstip: Different ways to round numbers in Javascript 🔥 */

const num = 9.15;

Number.parseInt(num, 10); // 9 (Converts number to an integer by dropping anything after the decimal)

Math.round(num); // 9 (Rounds up or down to the nearest integer)

Math.floor(num); // 9 (Rounds down to the nearest integer)

Math.ceil(num); // 10 (Rounds up to the nearest integer)

num | 0; // 9 (Same as Number.parseInt using...
  8. Math.max.apply(Math, [array])

  9. 7. ruj 2012.

    Find the max element in an array: Math.max.apply(Math, array); Similarly for min.

  10. 4. pro 2017.

    With ES6 WeakMaps you never need to add properties on elements or other objects you don’t own, and are supported even in IE11! Instead of = "bar", just do fooMap.set(element, "bar"); Important: WeakMap, not Map. Otherwise, you'll interfere with gc

  11. 12. srp 2018.

    🔥 Hot tip of the day: const ≠ immutable assignment ☹️❌👎 const = immutable binding 🙂❤️👍 Use Object.freeze( ) to make values immutable

  12. 8. stu 2018.

    Valuable JS tip by When in doubt, console.log() it out

  13. 7. svi 2019.

    In JavaScript, variables don't have types; values have type. Variables can hold any value at any time.

  14. 28. svi 2019.

    JS Developer Tip. Here's how to declare multiple variable names on a single line. Hat tip

    JS tip on declaring multiple variables on a single line.
  15. : Do you know setTimeout is not part of ECMAScript? Rather it's part of the HTML standard. See

  16. 18. ruj 2011.

    : If you often execute snippets of JS in the console to test something, run them in about:blank, so that the page doesn't interfere.

  17. 24. ruj 2019.

    don't use async/await in map or foreach function, instead use it in for(element of list) statement.

    Prikaži ovu nit
  18. 6. pro 2019.
  19. 21. tra 2018.

    🚧 Array.prototype.push might not return what you would expect. 🚧  🔥

  20. 31. srp 2015.

    To preserve accessors etc copy properties with Object.defineProperty(to, property, Object.getOwnPropertyDescriptor(from, property));

Č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.