Search completed in 0.89 seconds.
40 results for "valueOf":
Your results are loading. Please wait...
Object.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of the specified object.
... syntax object.valueof() return value the primitive value of the specified object.
... a (unary) plus sign can sometimes be used as a shorthand for valueof, e.g.
...And 12 more matches
Symbol.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of a symbol object.
... syntax symbol().valueof() return value the primitive value of the specified symbol object.
... description the valueof method of symbol returns the primitive value of a symbol object as a symbol data type.
...And 3 more matches
Date.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of a date object.
... syntax dateobj.valueof() return value the number of milliseconds between 1 january 1970 00:00:00 utc and the given date.
... description the valueof() method returns the primitive value of a date object as a number data type, the number of milliseconds since midnight 01 january, 1970 utc.
... examples using valueof() var x = new date(56, 6, 17); var myvar = x.valueof(); // assigns -424713600000 to myvar specifications specification ecmascript (ecma-262)the definition of 'date.prototype.valueof' in that specification.
String.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of a string object.
... syntax str.valueof() return value a string representing the primitive value of a given string object.
... description the valueof() method of string returns the primitive value of a string object as a string data type.
... examples using valueof() var x = new string('hello world'); console.log(x.valueof()); // displays 'hello world' specifications specification ecmascript (ecma-262)the definition of 'string.prototype.valueof' in that specification.
BigInt.prototype.valueOf() - JavaScript
the valueof() method returns the wrapped primitive value of a bigint object.
... syntax bigintobj.valueof() return value a bigint representing the primitive value of the specified bigint object.
... examples using valueof typeof object(1n); // object typeof object(1n).valueof(); // bigint specifications specification ecmascript (ecma-262)the definition of 'bigint.prototype.valueof()' in that specification.
Boolean.prototype.valueOf() - JavaScript
the valueof() method returns the primitive value of a boolean object.
... syntax bool.valueof() return value the primitive value of the given boolean object description the valueof() method of boolean returns the primitive value of a boolean object or literal boolean as a boolean data type.
... examples using valueof() x = new boolean(); myvar = x.valueof(); // assigns false to myvar specifications specification ecmascript (ecma-262)the definition of 'boolean.prototype.valueof' in that specification.
Number.prototype.valueOf() - JavaScript
the valueof() method returns the wrapped primitive value of a number object.
... syntax numobj.valueof() return value a number representing the primitive value of the specified number object.
... examples using valueof let numobj = new number(10) console.log(typeof numobj) // object let num = numobj.valueof() console.log(num) // 10 console.log(typeof num) // number specifications specification ecmascript (ecma-262)the definition of 'number.prototype.valueof' in that specification.
Bytecode Descriptions
the conversion can call .tostring()/.valueof() methods and can throw.
...the conversion can call .tostring()/.valueof() methods and can throw.
...the conversion can call .tostring()/.valueof() methods and can throw.
...And 9 more matches
StringView - Archive of obsolete content
nchrlen + nrawidx : asource.length; for (nrawidx; nrawidx < nrawend; nrawidx++) { if (!othat) { fcallback(asource[nrawidx], nrawidx, nrawidx, asource); } else { fcallback.call(othat, asource[nrawidx], nrawidx, nrawidx, asource); } } } }; stringview.prototype.valueof = stringview.prototype.tostring = function () { if (this.encoding !== "utf-8" && this.encoding !== "utf-16") { /* ascii, utf-32 or binarystring to domstring */ return string.fromcharcode.apply(null, this.rawdata); } var fgetcode, fgetincr, sview = ""; if (this.encoding === "utf-8") { fgetincr = stringview.getutf8charlength; fgetcode = stringview.loadutf8charcode; } el...
...gned long startfrom); domstring stringview.tobase64(optional boolean wholebuffer); stringview stringview.subview(unsigned long characteroffset, optional unsigned long characterslength); void stringview.foreachchar(function callback, optional object thisobject, optional unsigned long characteroffset, optional unsigned long characterslength); domstring stringview.valueof(); domstring stringview.tostring(); properties overview attribute type description encoding read only domstring a string expressing the encoding type.
... valueof() syntax stringview.valueof() description converts stringview's content into string and returns it.
...And 2 more matches
JXON - Archive of obsolete content
jxontree.prototype.valueof = function () { return this.keyvalue; }; jxontree.prototype.tostring = function () { return string(this.keyvalue); }; jxontree.prototype.getitem = function (nitem) { if (nlength === 0) { return null; } var ncount = 0; for (var skey in this) { if (ncount === nitem) { return this[skey]; } ncount++; } return null; }; jxontree.prototype.getattribute = function (nattrid) { if (nattrlen === 0...
...st(svalue)) { return null; } if (/^(?:true|false)$/i.test(svalue)) { return svalue.tolowercase() === "true"; } if (isfinite(svalue)) { return parsefloat(svalue); } if (isfinite(date.parse(svalue))) { return new date(svalue); } return svalue; } function objectify (vvalue) { if (vvalue === null) { return new (function() { this.tostring = function() { return "null"; } this.valueof = function() { return null; } })(); } return vvalue instanceof object ?
...l-3.0-standalone.html |*| \*/ function createxml (oobjtree) { function loadobjtree (oparentel, oparentobj) { var vvalue, ochild; if (oparentobj.constructor === string || oparentobj.constructor === number || oparentobj.constructor === boolean) { oparentel.appendchild(onewdoc.createtextnode(oparentobj.tostring())); /* verbosity level is 0 or 1 */ if (oparentobj === oparentobj.valueof()) { return; } } else if (oparentobj.constructor === date) { oparentel.appendchild(onewdoc.createtextnode(oparentobj.togmtstring())); } for (var sname in oparentobj) { if (isfinite(sname)) { continue; } /* verbosity level is 0 */ vvalue = oparentobj[sname]; if (sname === "keyvalue") { if (vvalue !== null && vvalue !== true) { oparentel.appendchild(onewd...
...And 2 more matches
Object prototypes - Learn web development
you will however also see some other members — tostring, valueof, etc — these are defined on person1's prototype object's prototype object, which is object.prototype.
...for example: person1.valueof() valueof() returns the value of the object it is called on.
... in this case, what happens is: the browser initially checks to see if the person1 object has a valueof() method available on it, as defined on its constructor, person(), and it doesn't.
...And 2 more matches
String - JavaScript
a string object can always be converted to its primitive counterpart with the valueof() method.
... console.log(eval(s2.valueof())) // returns the number 4 escape notation special characters can be encoded using escape notation: code output \xxx (where xxx is 1–3 octal digits; range of 0–377) iso-8859-1 character / unicode code point between u+0000 and u+00ff \' single quote \" double quote \\ backslash \n new line \r carriage return \v vertical tab \t tab \b backspace \f form feed \uxxxx (where xxxx is 4 hex digits; range of 0x0000–0xffff) utf-16 code unit / unicode code point between u+0000 and u+ffff \u{x} ...
... string.prototype.valueof() returns the primitive value of the specified object.
... overrides the object.prototype.valueof() method.
Inheritance and the prototype chain - JavaScript
{ constructor: ƒ dosomething(), __proto__: { constructor: ƒ object(), hasownproperty: ƒ hasownproperty(), isprototypeof: ƒ isprototypeof(), propertyisenumerable: ƒ propertyisenumerable(), tolocalestring: ƒ tolocalestring(), tostring: ƒ tostring(), valueof: ƒ valueof() } } we can add properties to the prototype of dosomething(), as shown below.
... "bar"; console.log( dosomething.prototype ); this results in: { foo: "bar", constructor: ƒ dosomething(), __proto__: { constructor: ƒ object(), hasownproperty: ƒ hasownproperty(), isprototypeof: ƒ isprototypeof(), propertyisenumerable: ƒ propertyisenumerable(), tolocalestring: ƒ tolocalestring(), tostring: ƒ tostring(), valueof: ƒ valueof() } } we can now use the new operator to create an instance of dosomething() based on this prototype.
...e value", __proto__: { foo: "bar", constructor: ƒ dosomething(), __proto__: { constructor: ƒ object(), hasownproperty: ƒ hasownproperty(), isprototypeof: ƒ isprototypeof(), propertyisenumerable: ƒ propertyisenumerable(), tolocalestring: ƒ tolocalestring(), tostring: ƒ tostring(), valueof: ƒ valueof() } } } as seen above, the __proto__ of dosomeinstancing is dosomething.prototype.
Object - JavaScript
object.prototype.valueof() returns the primitive value of the specified object.
... var current = object.prototype.valueof; // since my property "-prop-value" is cross-cutting and isn't always // on the same prototype chain, i want to modify object.prototype: object.prototype.valueof = function() { if (this.hasownproperty('-prop-value')) { return this['-prop-value']; } else { // it doesn't look like one of my objects, so let's fall back on // the default behavior by reproducing the current behavior a...
... // even though valueof() doesn't take arguments, some other hook may.
Introducing the Audio API extension - Archive of obsolete content
var prebuffersize = samplerate * 0.020; // initial buffer is 20 ms var autolatency = true, started = new date().valueof(); ...
... // auto latency detection if (autolatency) { prebuffersize = math.floor(samplerate * (new date().valueof() - started) / 1000); if (audio.mozcurrentsampleoffset()) { // play position moved?
JSObjectOps.defaultValue
it calls the javascript methods obj.valueof() and/or obj.tostring().
... js_convertstub implements the default behavior for the jsclass.convert hook, which is to call obj.valueof() and obj.tostring() in accordance with the algorithm in es5 §8.12.8.
JS_ValueToObject
if v is a native javascript object, this calls the object's valueof method, if any.
...note that a local root scope is not sufficient to protect the resulting object in some cases involving the valueof method!
Deprecated and obsolete features - JavaScript
the valueof method is no longer specialized for regexp.
... use object.valueof().
BigInt - JavaScript
bigint.prototype.valueof() returns the primitive value of the specified object.
... overrides the object.prototype.valueof() method.
Boolean - JavaScript
boolean.prototype.valueof() returns the primitive value of the boolean object.
... overrides the object.prototype.valueof() method.
Date.prototype[@@toPrimitive] - JavaScript
if the tostring property does not exist, it tries to call the valueof method and if the valueof does not exist either, [@@toprimitive]() throws a typeerror.
... if hint is "number", [@@toprimitive]() first tries to call valueof, and if that fails, it calls tostring.
Date - JavaScript
date.prototype.valueof() returns the primitive value of a date object.
... overrides the object.prototype.valueof() method.
Number - JavaScript
number.prototype.valueof() returns the primitive value of the specified object.
... overrides the object.prototype.valueof() method.
Object.create() - JavaScript
ocn // throws error: cannot convert object to primitive value testing just a few of the many most basic built-in functions shows the magnitude of the problem more clearly: > alert(oco) // shows [object object] > alert(ocn) // throws error: cannot convert object to primitive value > oco.tostring() // shows [object object] > ocn.tostring() // throws error: ocn.tostring is not a function > oco.valueof() // shows {} > ocn.valueof() // throws error: ocn.valueof is not a function > oco.hasownproperty("p") // shows "true" > ocn.hasownproperty("p") // throws error: ocn.hasownproperty is not a function > oco.constructor // shows "object() { [native code] }" > ocn.constructor // shows "undefined" as said, these differences can make debugging even simple-seeming problems quickly go astray.
...ect object] however, setting the generic prototype as the new object's prototype works even better: ocn = object.create( null ); // create "null" object (same as before) object.setprototypeof(ocn, object.prototype); // set new object's prototype to the "generic" object (not standard-object) (in addition to all the string-related functions shown above, this also adds:) > ocn.valueof() // shows {} > ocn.hasownproperty("x") // shows "false" > ocn.constructor // shows "object() { [native code] }" // ...and all the rest of the properties and methods of object.prototype.
Symbol - JavaScript
symbol.prototype.valueof() returns the primitive value of the symbol object.
... overrides the object.prototype.valueof() method.
WebAssembly.Global - JavaScript
instance methods global.prototype.valueof() old-style method that returns the value contained inside the global variable.
... 69firefox android full support 62opera android no support nosafari ios no support nosamsung internet android full support 10.0nodejs no support novalueofchrome full support 69edge no support nofirefox full support 62ie no support noopera no support nosafari no support nowebview andr...
jspage - Archive of obsolete content
;}};(function(){var a={array:array,date:date,function:function,number:number,regexp:regexp,string:string};for(var h in a){new native({name:h,initialize:a[h],protect:true}); }var d={"boolean":boolean,"native":native,object:object};for(var c in d){native.typize(d[c],c);}var f={array:["concat","indexof","join","lastindexof","pop","push","reverse","shift","slice","sort","splice","tostring","unshift","valueof"],string:["charat","charcodeat","concat","indexof","lastindexof","match","replace","search","slice","split","substr","substring","tolowercase","touppercase","valueof"]}; for(var e in f){for(var b=f[e].length;b--;){native.genericize(a[e],f[e][b],true);}}})();var hash=new native({name:"hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getclean()); }for(var b in a){this[b]=a[b];}return t...
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
the wrapper's valueof() method returns the primitive value.
JS_PropertyStub
it attempts to call the object's valueof and tostring functions, in the order determined by the specified type, in accordance with the default defaultvalue algorithm in es5 §8.12.8.
JS_ValueToNumber
for objects of standard classes, this is js_convertstub, which simply calls v.valueof() if present.
JS_ValueToString
for standard classes, this is js_convertstub, which simply calls v.valueof() if present.
TransformStream - Web APIs
stream is done i guess if (chunk === null) controller.terminate() else if (arraybuffer.isview(chunk)) controller.enqueue(new uint8array(chunk.buffer, chunk.byteoffset, chunk.bytelength)) else if (array.isarray(chunk) && chunk.every(value => typeof value === 'number')) controller.enqueue(new uint8array(chunk)) else if ('function' === typeof chunk.valueof && chunk.valueof() !== chunk) this.transform(chunk.valueof(), controller) // hack else if ('tojson' in chunk) this.transform(json.stringify(chunk), controller) break case 'symbol': controller.error("cannot send a symbol as a chunk part") break case 'undefined': controller.error("cannot send undefined as a chunk part") default: ...
Equality comparisons and sameness - JavaScript
toprimitive(a) attempts to convert its object argument to a primitive value, by attempting to invoke varying sequences of a.tostring and a.valueof methods on a.
Date.prototype.getTime() - JavaScript
this method is functionally equivalent to the valueof() method.
Object.keys() - JavaScript
ly support it, copy the following snippet: // from /docs/web/javascript/reference/global_objects/object/keys if (!object.keys) { object.keys = (function() { 'use strict'; var hasownproperty = object.prototype.hasownproperty, hasdontenumbug = !({ tostring: null }).propertyisenumerable('tostring'), dontenums = [ 'tostring', 'tolocalestring', 'valueof', 'hasownproperty', 'isprototypeof', 'propertyisenumerable', 'constructor' ], dontenumslength = dontenums.length; return function(obj) { if (typeof obj !== 'function' && (typeof obj !== 'object' || obj === null)) { throw new typeerror('object.keys called on non-object'); } var result = [], prop, i; for ...
String.prototype.toString() - JavaScript
for string objects, the tostring() method returns a string representation of the object and is the same as the string.prototype.valueof() method.
parseFloat() - JavaScript
parsefloat will parse non-string objects if they have a tostring or valueof method.
Equality (==) - JavaScript
if one of the operands is an object and the other is a number or a string, try to convert the object to a primitive using the object's valueof() and tostring() methods.
Logical NOT (!) - JavaScript
n3 = !!(new boolean(false)) // ...even boolean objects with a false .valueof()!
throw - JavaScript
*/ function zipcode(zip) { zip = new string(zip); pattern = /[0-9]{5}([- ]?[0-9]{4})?/; if (pattern.test(zip)) { // zip code value will be the first match in the string this.value = zip.match(pattern)[0]; this.valueof = function() { return this.value }; this.tostring = function() { return string(this.value) }; } else { throw new zipcodeformatexception(zip); } } function zipcodeformatexception(value) { this.value = value; this.message = 'does not conform to the expected format for a zip code'; this.tostring = function() { return this.value + this.m...