• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

In JS We Trust

trung tâm giáo dục thường xuyên javascript: youtube.com/hoccoban

  • giới thiệu
  • js cơ bản
  • bài tập
  • interview
  • tài nguyên

Bài tập về scope khi copy hàm của object

by Vuong Nguyen
December 28, 2018January 3, 2019Filed under:
  • bài tập
let bien1 = 10; 
let object1 = {
 bien1: 2,
 inra: function(){
 console.log(this.bien1); 
 }
}

object1.inra(); //2
let copy = object1.inra; /
copy(); //10

// tương tự die() trong php 

throw new Error("die()");  

Nguồn JS Land

 

Post navigation

Previous Post 2. Các loại dữ liệu trong Javascript
Next Post 3. Hằng số sẵn có trong JavaScript

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Bài viết mới

  • Server lưu JWT là một sai lầm, tại sao lại như thế?
  • 6 ways to avoid callback hell
  • testing object and prototype
  • 6 ways to create object in JavaScript
  • Kế thừa Prototype ngang và dọc

Chuyên mục

  • bài tập
  • js cơ bản
  • tips
  • web

Comments

  • admin on Kế thừa Prototype ngang và dọc
  • Nguyen Van Tu on Kế thừa Prototype ngang và dọc
  • admin on Kế thừa Prototype ngang và dọc
  • admin on Kế thừa Prototype ngang và dọc
  • admin on Kế thừa Prototype ngang và dọc

Copyright © 2021 · Milan Pro on Genesis Framework · WordPress · Log in