Prototype Questions
Ad
Quick C# prototype program with simple DB
Okay, i've seen but haven't programmed in c# before. you can assume i'm competent in c++, and advanced in c (for what good that'll do me). i
prototype methods do not visible in constructor if module load with require('moduleName')
I have a simple module, it's code var router = function(pattern) { this.setroutepattern(pattern); };
Getting the img tag inside iframe
I have an iframe with a class name="blaclass". inside it, i have one div with no name (or id) and inside this id there is a div with class name =
jQuery and Prototype Selector Madness
Both the jquery and prototpye javascript libraries refuse to allow me to use a variable to select an list item element by index number although
"undefined handler" from prototype.js line 3877
A very niche problem: i sometimes (30% of the time) get an 'undefined handler' javascript error on line 3877 of the prototype.js library
Javascript Prototype chaining change the target
I am a student studying programming. i have a question. function a () { } a.prototype.prtsomething =
Looping through custom react components and adding className's to them
I want to loop through custom react elements using .map(). an example of what i'm looping through is: <button
Javascript New Array Functionality
I came across the below code in one website and i am unable to understand the line commented as "doubt". how is the function returning the
parse string from an api to html
I have api call that sets a collection of 10 objects into a state array. below is an example of that code: class example extends
Why assignment to the doesn't the object __proto__ doesn't work?
Case 1 :- initially in object literal i assign __proto__ to null and then i'm trying to reassign it to animal, which is
Ad
getOwnPropertyDescriptor of redefined toString should be undefined
I have redefined tostring of htmlcanvaselement.prototype.todataurl. when i am getting property descriptor of
managing the state of looped radio buttons in react
So i have an api. i have to drill down into it, so i start by mapping over all the response data, then do another map inside of that to get an
multiple ternary operator inside a map
I have an api response that returns 1 of 7 different numbers. each of those numbers represents a different word. (1 = complete, 2 = pending,
I have changed to PropTypes to "prop-types" but still get Error evaluating React.PropTypes
Environment: os: linux 5.3 node: 12.16.1 yarn: 1.21.1 npm: 6.13.4 watchman: 4.9.0 xcode: n/a android studio: 3.5
passing mapped data from an api to another component
So i have data that i get from an api in componentdidmount, and then i map over it in the render. lets say the map returns 4 objects. how do i
Defining the custom-element's lifecycle callbacks inside of the constructor
The following defines, creates and finally inserts an instance of my "autonomous custom element" onto the container:
How can I use attributes directly in methods of Javascript prototype?
I am used to coding with objects in different languages such as java, python, … i have never used javascript objects before and i am stuck with
Why doing Object.create(null) and later setting its prototype to Object.prototype will not allow to execute methods in Object.prototype
I was tweaking with object.create() method. when i execute following code, i expect that my object should be able to use methods in
Why doesn't the following prototype declaration work?
I have declared array prototype myarraymax and the code seems right after repeated verifications from other resources on w3schools.com :
ES6 map array of objects to array
There is an array of objects const data = [{ "name": "08/20/2018", "id": "name_1" }, { "name": "12/23/2018",
Ad
Got "TypeError: Cannot convert undefined or null to object" in Function.prototype
For learning purpose, i wrote a piece of (meaningless) code like this:
Regex match counting quantity of digits
I want to create a regexp that counts how many numbers i have within the string, but they don't have to be in order. it can be separated.
Problem extending native (es6) classes in Safari
I'm having trouble extending the native websocket class using es6 classes. the following piece of code works on chrome and
How do I (and should I) make additional methods on DOM objects?
I want to extend an element by a method, but i've heard it is a bad idea. therefore i'm wondering if it is possible to make a class so that its
Javascript: How to call a function from multiple prototypes?
Good day, i'm coding with phaser 3 and javascript then tried doing classes like so:
How to map a key/value array instead of an object
I need to get some value from some forms so when i need to call the specific value from a form i want to call for the particular key in an array.
prototype can't passing property value even create new 'this'
I follow a tutorial to using prototype to define methods of object. however, i still can't passing the property by using either this or
Limit character length of mapped value in React
I have a functional react component with text that is displayed from a mapped array. how can i limit the character count of
React native render more dimensional array
I would like to map a more dimensional array that looks like this: const array = [ { name: "anna", items: ["bread",
Why is instanceof not working as expected in Typescript?
So i have these classes that i use to handle errors in different scenerios like so: export class apierror extends error {
JavaScript Prototype Pattern in ES6
The prototype pattern is implemented in es5 as follows: var shape = function (id, x, y) { this.id = id; this.move(x, y); };
Ad
Getter / Setter and Prototype Chain
In a current javascript project where es6 class syntax and get/set syntax are used i stumbled upon a behaviour i cannot explain. first, an
JavaScript: how to remove a particular element from an array
I am trying to create a shopping cart using vanilla javascript and oojs concepts.
NodeJS calling prototype from another
I keep getting x is not a function when trying to use another method on the same object. test code below: object1 :
Resources to learn : Javascript prototype object model?
I am pretty new to in-depth javascript. now, since i come from the world of c/c++ or java type
Is `Object` a function in JavaScript?
Consider this function: function foo(){ var a = "3"; }; according to
Can not extend this JavaScript object
I checked some question with similar issues but could not cope with mine where i have a file.js: 'use strict'
What is a practical advantage of Object.create over Constructor function?
So i am coming from classical oop language and trying to wrap my head around javascript prototypical style. trying to understand the
A function without parameters in C
i know that “the empty list in a function declarator that is not part of a definition of that function specifies
How to iterate through instances of a prototype "class" JS
I want a "for" or "while" loop to iterate through all the instances/objects in the prototyp/"class". like "hasnext()" in array. then i
What different between marked objects with arrow in javascript?
I've a javascript object, when i log object in console, in object properties i've 2 type marked with arrow in picture. what's different
What is this second sentence exactly saying?
since an argument of a function call is an expression, type conversions also take place when arguments are passed to function. in
Ad
Adding an input field to the dom and focusing it in IE
I am trying to make a div, that when you click it turns into an input box, and focuses it. i am using prototype to achieve this. this works in
C function prototype: \\char *strinv(const char *s);
Char *strinv(const char *s); //that's the given prototype i'm a bit insecure about the *strinv part. does it mean that
Property inheritance involving objects and prototypes
I'm a newbie at js and in one of my tests i've been trying to figure out how the following code works in terms of property inheritance.
python prototype structure, not working
Whenever i print the c1 object, it prints: <main.car object at 0x7fde8b29a240> however i added the
Access method from class in react component
I have my model.js like this : export class piece { constructor(name, coordinate) { this.name = name; this.coordinate =
Function that returns a function that retrieves a membervariable
Consider: const compose = <s, t, r>(func1: (inp2: t) => r, func2: (inp: s) => t): (inp: s) => r => ((arg: s)
Object literal constructor
I am looking for a way to modify an object that was defined by a literal without passing it into another function. example:
How to render array of objects in the same <li> tag in React?
I got some nested arrays. something like this: [array(2), array(2), ...]
Custom Iterator for Number Prototype in JS
Recently i learned about js iterators, beeing used in a for( of ) loops. since in js even primitives have a prototype, i wondered if
ReactJs - API Feed Error - cannot read property of map undefined
I was hoping you could help me out. i'm trying to plugin a simple tfl tube api into my web page, using axios/reactjs. the integration
JavaScript: what is the most advantage that we got when we use Object.create
Can we simply assign a value rather than using object.create? rectangle.prototype = shape.prototype; rectangle.prototype =
Ad
Why Array's have a given property length, why it's not in prototype?
Hello i've learned that inheritance happens with prototypes. what i don't understand is, let's say: we create a simple array const
Preferred way of defining common fields in JavaScript: on prototype or constructor?
What is the preferred way of defining common fields for all instances of a class in javascript? via prototype or constructor?
How can we use 'new' on a function if not reassigned constructor
In this prototypal inheritance example, if we skip to reassign the constructor then how can we use a keyword 'new' on it? according to
javascript Function.prototype issue
I started learning javascript and have below question:
Javascript: refactoring existing code to separate concerns, how could we use a class/Prototype and call from it own objects' methods?
I have a web page where i show two models, each one in a canvas using threejs. i would like to read a local file, parse it and then make
Getting Function.prototype.bind.apply(...) is not a constructor error
I am trying to simulate controller inheritance in angularjs (1.6.9), but i am getting an error on console as :
Chosen Selector
I have multiple instances of chosen selector being used in a page. totally 5 instances as you can see in the code(fiddle link
Perl 5 signatures: Passing multiple arrays
I was hoping that with the signatures feature in perl 5 (e.g. in version 5.34.0), something like this would be possible: use
What happens to the property inherited from base object when later that property of derived object is set again?
Here object.create() is used for inheritance. the javascript code:
print scroll position in Framer.js
I'm prototyping in framer.js. i have a scroll component and scroll content, i'm trying to print the current x or scrollx position of the content.
JavaScript and __proto__ - what browsers use it?
What web browsers use the __proto__?
Ad
Change the start of the year in moment.js
I am using momentjs for date calculations. here i want to change start of year for weeks calculation. for me start of year will
Prototype JS Override Data OnSubmit
I'm trying to override some data via prototope js before submitting the form. how can i achieve it? here's the snippet:
How to extend Javascript Prototype?
I instantiate a function from my template with new product.image({ "title": document.queryselector('#image-title') });
JavaScript: Is the nesting of constructor instances inside a constructed 'wrapper' problematic?
Hopefully this question won't be flagged as too subjective but i'm newish to oop and struggling a bit when it come to sharing data
Properties declared in constructor function vs prototype
Now before i get flagged for a duplicate question, please hear me out. i know this question has been asked many times before, such as in
javascript prototypical inheritance confused
Given the standard way of achieving inheritance like this function baseclass() { } function subclass() {
How to write a polyfill for array.prototype.find as a custom method?
Question: how do i write a custom array.prototype.find() and not add it to the array.prototype? i would like to
How can I make a prototype function to all my object properties?
I have an object of functions and i like to prototype another function to all of these properties. example: var test = function(num) { return
Overwrite the this value in array.prototype
I've found that the native js sort function screws up from time to time so i wanted to implement my own. lets say i have the following :
Javascript - Prototyping on DOM elements
I'm building custom libraries to handle gui and creating divs and stuff programatically. i also want to extend these objects with children and methods to do something like
Ad
Blog Categories
Ad