About 350,000 results
Open links in new tab
  1. Build your own function - Learn web development | MDN - MDN Web Docs

    Apr 11, 2025 · An understanding of HTML and the fundamentals of CSS, familiarity with JavaScript function basics as covered in the previous lesson. Learning outcomes: Experience …

  2. How do you create a method for a custom object in JavaScript?

    var myObj=function(){ var value=null this.setValue=function(strValue){ this.value=strValue; }; this.getValue=function(){ return this.value; }; }; You can call this object like this: var obj= new …

  3. Built-in functions and how to create custom functions

    Aug 9, 2023 · JavaScript provides a variety of built-in functions that you can use to perform common tasks. Additionally, you can create your own custom functions to encapsulate logic …

  4. What are Functions in JavaScript? A Beginner's Guide

    Jun 30, 2022 · In this article, you will learn what functions are in JavaScript, how to write your own custom functions, and how to implement them. As a prerequisite, you should be familiar with …

  5. Creating Custom JavaScript Functions: Best Practices and Examples

    Feb 28, 2023 · Creating custom JavaScript functions can make your code more efficient, readable, and maintainable. In this blog post, we'll cover some of the best practices for …

  6. Functions | create custom JavaScript methods

    Aug 21, 2012 · Functions are the workhorses of JavaScript. A basic function looks like this: function addNumbers(a,b) { var c = a+b; return c; } This function will add any two numbers we …

  7. javascript - Adding custom properties to a function - Stack Overflow

    Dec 21, 2011 · Adding your own custom properties to a function can be done in different ways that should work in every browser. Way 1 : adding properties while running the function : …

  8. Build your own function - Learn web development | MDN

    May 30, 2017 · This article took you through the entire process of building up a practical custom function, which with a bit more work could be transplanted into a real project. In the next article …

  9. JavaScript – Make Custom Functions with Prototype

    In the current article, I will show you how to build functions for built-in objects in JavaScript. The way I know is using a prototype . Thus, I will create functions, giving us the last n values of an …

  10. JavaScript Prototyping: Extending Built-in Objects with Custom Functions

    Apr 8, 2025 · In this guide, we'll explore how prototyping works and demonstrate practical examples of extending built-in objects. Every JavaScript object has a hidden [[Prototype]] …

Refresh