5̓R[hꗗ

LESSON 11@f[^ZbgňuIuWFNgv

SECTION 1@֘Af[^܂Ƃ߂

u{[yv̏萔ɓ

const productName = '{[y';
const productPrice = 220;
const productCode = 'PEN-001';

{[ỹIuWFNg

function createObject() {
  const product = {
    name: '{[y',
    price: 220,
    code: 'PEN-001'
  };
  
  console.log(product);
}

LESSON 12@vpeB̒lǂݏ悤

SECTION 1@lo

function readProperty() {
  const product = {
    name: '{[y',
    price: 220,
    code: 'PEN-001'
  };
  console.log(product.name);
  console.log(product.price);
  console.log(product.code);
}

SECTION 2@l

{[ỹIuWFNg

function changeProperty() {
  const product = {
    name: '{[y',
    price: 220,
    code: 'PEN-001'
  };
  product.price = 250;
  console.log(`Vi : ${product.price} ~`);
}

LESSON 13@IuWFNgɓu\bhv

SECTION 2@\bhĂ݂悤

{[yɃ\bhǉ

function useMethod() {
  const product = {
    name: '{[y',
    price: 220,
    announce() {
      console.log('VIlC̏iłI');
    }
  };
  product.announce();
}

SECTION 3@̃f[^guthisv

{[yɃ\bhǉ

function useThis() {
  const product = {
    name: '{[y',
    price: 220,
    announce() {
      console.log(`VIlC ${this.name} łI ${this.price} ~Ŕ̔I`);
    }
  };
  product.announce();
}

LESSON 14@gݍ݃IuWFNgg

SECTION 2@{̓uJavaScript̃IuWFNgv

_Ȑ

function useMath() {
  const number = Math.random();
  console.log(number);
}

SECTION 3 GoogleT[rX𑀂uGAS̃IuWFNgv

XvbhV[gɁuɂ́vƓ͂

function useSpreadsheet() {
  const sheet = SpreadsheetApp.getActiveSheet();
  sheet.getRange('A1').setValue('ɂ');
}

XvbhV[gɃt@CƃV[g͂

function useSpreadsheet2() {
  const spreadSheet = SpreadsheetApp.getActiveSpreadsheet(); 
  const spreadSheetName = spreadSheet.getName();
  const sheet = spreadSheet.getActiveSheet();
  const sheetName = sheet.getName();
  sheet.getRange('A1').setValue(spreadSheetName);
  sheet.getRange('A2').setValue(sheetName);
}