informatique:javascript:tests_de_compatibilite
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| informatique:javascript:tests_de_compatibilite [05/05/2018 19:11] – [Assign simple with scalar properties] cyrille | informatique:javascript:tests_de_compatibilite [05/05/2018 19:17] (Version actuelle) – cyrille | ||
|---|---|---|---|
| Ligne 49: | Ligne 49: | ||
| </ | </ | ||
| - | ====== Object.assign() | + | ====== Object |
| - | ===== Assign simple with scalar properties ===== | + | ===== Object.assign() - only scalar properties ===== |
| Should be write 1,2 : | Should be write 1,2 : | ||
| Ligne 61: | Ligne 61: | ||
| var o2 = Object.assign( o1, { b:2 } ); | var o2 = Object.assign( o1, { b:2 } ); | ||
| | | ||
| - | } catch ( e ) | + | } catch ( e ){ |
| - | { | + | |
| | | ||
| } | } | ||
| Ligne 68: | Ligne 67: | ||
| </ | </ | ||
| - | ===== Assign simple with complex properties ===== | + | ===== Object.assign() - complex properties ===== |
| Should be write 1,2 : | Should be write 1,2 : | ||
| Ligne 74: | Ligne 73: | ||
| < | < | ||
| < | < | ||
| - | var o1 = { a:1 }; | + | try { |
| - | var o2 = Object.assign( o1, { b: | + | var o1 = { a:1 }; |
| - | document.write( '< | + | var o2 = Object.assign( o1, { b: |
| + | | ||
| + | } catch ( e ){ | ||
| + | | ||
| + | } | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | ===== Object.create() - complex properties ===== | ||
| + | |||
| + | Should be write 1,2 : | ||
| + | |||
| + | < | ||
| + | < | ||
| + | try { | ||
| + | var o1 = { a:1, b: | ||
| + | var o2 = Object.create( o1 ); | ||
| + | | ||
| + | } catch ( e ){ | ||
| + | | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
informatique/javascript/tests_de_compatibilite.1525540305.txt.gz · Dernière modification : de cyrille
