DeveloperBreeze

Javascript Programming Tutorials, Guides & Best Practices

Explore 93+ expertly crafted javascript tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from DeveloperBreeze.

Non-Primitive Data Types (Objects, Arrays, and Functions)

Tutorial December 11, 2024
javascript

  function greet(name) {
    return `Hello, ${name}!`;
  }
  console.log(greet("Alice")); // "Hello, Alice!"
  • Function Expression:

JavaScript Tutorial for Absolute Beginners

Tutorial September 02, 2024
javascript

Let’s start with a simple script that displays a message in the browser’s console.

console.log("Hello, World!");

Understanding call, apply, and bind in JavaScript

Tutorial August 30, 2024
javascript

functionName.apply(thisArg, [arg1, arg2, ...]);
function greet(greeting, punctuation) {
    console.log(greeting + ' ' + this.name + punctuation);
}

const person = { name: 'Alice' };

greet.apply(person, ['Hello', '!']);  // Output: "Hello Alice!"

JavaScript Utility Libraries Cheatsheet

Cheatsheet August 21, 2024
javascript

Date-fns is a modern JavaScript date utility library that provides over 200 functions for manipulating dates without modifying native JavaScript objects.

<table>
  <tr>
    <th>Function</th>


 <th>Description</th>
    <th>Example</th>
  </tr>
  <tr>
    <td><code>format(date, formatString)
    Formats the date according to the provided format string.
    format(new Date(), 'MMMM do, yyyy') => 'September 20th, 2024'
  
  
    addDays(date, amount)
    Returns a new date with the specified number of days added.
    addDays(new Date(), 10) => Date object 10 days in the future
  
  
    differenceInDays(dateLeft, dateRight)
    Returns the number of days between two dates.
    differenceInDays(new Date('2024-09-20'), new Date('2024-09-10')) => 10
  
  
    isBefore(date, dateToCompare)
    Checks if the first date is before the second one.
    isBefore(new Date('2024-09-10'), new Date('2024-09-20')) => true
  
  
    parse(dateString, formatString, referenceDate)
    Parses a date string according to the provided format string.
    parse('20th September 2024', 'do MMMM yyyy', new Date()) => Date object for 20th September 2024