Advertisement
apl-mhd

JavaScript Object

Oct 29th, 2018
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2.  
  3.  
  4.  
  5.  
  6.   console.log(document.querySelector('body').childNodes);
  7.  
  8.     var person = {
  9.  
  10.  
  11.  
  12.         name :{
  13.  
  14.             firstName : 'Apel',
  15.             lastName : 'mahmud',
  16.  
  17.         },
  18.  
  19.  
  20.         /*name : ['Apel', 'Mahmud'],*/
  21.         id : ['011161036'],
  22.         dept : ['cse'],
  23.         interest : ['photography'],
  24.  
  25.         greeting : ['I travel for photography'],
  26.  
  27.         fullName : function () {
  28.  
  29.             return this.name.firstName + this.name.lastName;
  30.         }
  31.     }
  32.  
  33.  
  34.     person.display = function(){
  35.  
  36.         return 'hello world';
  37.     }
  38.  
  39.  
  40.     console.log(person.fullName());
  41.  
  42.     console.log(person.display)
  43.  
  44.  
  45.  
  46.  
  47. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement