Python OOP learning notes-1
1. python standard library: python 3.9.4
(1)format():
format(value[, format_spec])
Convert # value # to # format_ "Formatted" representation of spec # control. format_ The interpretation of spec , depends on the type of , value , argument, but most built-in types use standard formatting syntax: Format specification Mini lan ...
Added by Trek15 on Wed, 02 Mar 2022 02:20:42 +0200
New methods of Object object Object in core JS: assign, is, setPrototypeOf- Explanation of use
Object.is()
ES5 compares whether two values are equal. There are only two operators: the equality operator (= =) and the strict equality operator (= =). Both of them have disadvantages. The former will automatically convert the data type, while the NaN of the latter is not equal to itself, and + 0 is equal to - 0. JavaScript lacks an operation ...
Added by spiyun on Thu, 10 Feb 2022 14:30:04 +0200
Java object cloning
What is cloning
cloning, as the name suggests, is to clone an object's information to generate a new object. Then someone must have asked, why clone when there is new? Because the properties of new objects are initialized values, while those of clone objects can save the existing state of the object. When we need to temporarily save the ...
Added by PRSBOY on Fri, 14 Jan 2022 10:24:12 +0200
JS object inheritance
Prototype chain inheritance
Idea: let an instance object replace the prototype of the constructor, then the new instance object from the constructor has all the properties and methods of the current object and the methods on the prototype chain.
function Parent(age) {
this.name = "father";
this.age = age;
...
Added by payjo on Wed, 05 Jan 2022 23:16:21 +0200