Advertisement
soden

Untitled

Feb 28th, 2024
587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.26 KB | Source Code | 0 0
  1. // Objek menggunakan literal
  2. let mahasiswa = {
  3.     nama: "Syarif",
  4.     nim: "12345",
  5.     jurusan: "Informatika",
  6.     getInfo: function() {
  7.         return this.nama + " (" + this.nim + ") - " + this.jurusan;
  8.     }
  9. };
  10.  
  11. console.log(mahasiswa.getInfo());
  12.  
Tags: JavaScript
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement