Skip to content

Instantly share code, notes, and snippets.

View tuanlc's full-sized avatar
🌤️
Focusing

Cong Tuan Le tuanlc

🌤️
Focusing
View GitHub Profile
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
   return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Student_1 = __importDefault(require("./Student"));
function main() {
   const student = new Student_1.default('John Doe', 'john@abc.com', '012345678');
student.playGame();
import Student from './Student';

function main() {
  const student = new Student('John Doe', 'john@abc.com', '012345678');

  (student as any).playGame();

  console.log((student as any).phone);
}
src/index.ts:6:11 - error TS2341: Property 'playGame' is private and only accessible within class 'Student'.

6   student.playGame();
            ~~~~~~~~

src/index.ts:8:23 - error TS2341: Property 'phone' is private and only accessible within class 'Student'.

8   console.log(student.phone);
 ~~~~~
import Student from './Student';

function main() {
  const student = new Student('John Doe', 'john@abc.com', '012345678');
  
  student.playGame();

  console.log(student.phone);
}
 export default class Student {
  name: string;
  email: string;
  private phone: string;
  
  constructor(name: string, email: string, phone: string) {
    this.name = name;
    this.email = email;
 this.phone = phone;
pick dbbff15 First commit
fixup afa2cee fixup! First commit
fixup d6f0da6 fixup! First commit
pick 11804b6 Second commit
fixup d8e4185 fixup! Second commit
11804b6 Second commit
dbbff15 First commit
pick c797a94 First commit
fixup 9e98aa0 fixup! First commit
pick ce13566 Second commit
9e98aa0 fixup! First commit
ce13566 Second commit
c797a94 First commit
git rebase --help

--autosquash, --no-autosquash
           When the commit log message begins with "squash! ..." (or "fixup!
           ..."), and there is already a commit in the todo list that matches
           the same ..., automatically modify the todo list of rebase -i so
           that the commit marked for squashing comes right after the commit
           to be modified, and change the action of the moved commit from pick
 to squash (or fixup). A commit matches the ... if the commit