Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. <script>
  2. var s = "Hallo";
  3. var s2 = s;
  4. s = s + " Welt!";
  5.  
  6. // console.log('s', s);
  7. // console.log('s2', s2);
  8.  
  9.  
  10. //var x = 0.3;
  11. //var y = 0.2;
  12. //var z = y-x;
  13.  
  14. //console.log(z);
  15.  
  16.  
  17. document.write(5 / "abc");
  18. document.write("<br>");
  19. document.write('19" Effektgerät');
  20. document.write("<br>");
  21. document.write("It's my party");
  22. document.write("<br>");
  23. document.write('It\'s my party');
  24. document.write("<br>");
  25.  
  26. document.write('Hallo \t\t Welt');
  27. document.write("<br>");
  28. document.write('Hallo du\t Welt\nEine neue Zeile');
  29. document.write("<br>");
  30. document.write('alpha\\beta');
  31. document.write("<br>");
  32.  
  33. document.write("Hallo " * 5);
  34. document.write("<br>");
  35.  
  36. var s = "Hallo Welt@fhws";
  37. document.write('slice', s.slice(3,5));
  38. document.write("<br>");
  39.  
  40. document.write('index of @', s.indexOf('@'));
  41. document.write("<br>");
  42.  
  43.  
  44. var z = "John Chad Anthony Flea";
  45. var zz = z.split(' ');
  46.  
  47. document.write(zz);
  48. document.write("<br>");
  49.  
  50.  
  51. if (5-3) {
  52. document.write('true');
  53. document.write("<br>");
  54. }
  55.  
  56. if (5-5) {
  57. document.write('false');
  58. document.write("<br>");
  59. }
  60.  
  61.  
  62.  
  63.  
  64. // Objektbeispiel
  65.  
  66. var o = {
  67. "Name" : "Rolf Schillinger",
  68. "Strasse" : "Sanderheinrichsleitenweg 20",
  69. "email" : "rolf.schillinger@fhws.de",
  70. "x" : function() {document.write('Testfunktion in Objekt')}
  71. };
  72.  
  73. document.write('Objektbeispiel', o);
  74. document.write("<br>");
  75. document.write('Objektbeispiel Name', o.Name);
  76. document.write("<br>");
  77. o.x();
  78. document.write("<br>");
  79.  
  80.  
  81. // Array Beispiel
  82.  
  83. var a = [1, 5, 10 ,30];
  84. document.write('Array Beispiel', a);
  85. document.write("<br>");
  86. a.length = 2;
  87. document.write('Array Beispiel 2', a);
  88. document.write("<br>");
  89. a[300000] = 50;
  90. document.write('Array Beispiel 3', a);
  91. document.write("<br>");
  92. document.write('Array Beispiel 3', a.length);
  93. document.write("<br>");
  94. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement