কম্পিউটার

জাভাস্ক্রিপ্টে Map.delete() ফাংশন


মানচিত্র অবজেক্টের ডিলিট() ফাংশন একটি মানচিত্রের একটি উপাদানের কী প্রতিনিধিত্বকারী একটি স্ট্রিং গ্রহণ করে এবং বর্তমান মানচিত্র অবজেক্ট থেকে মুছে দেয়। মানচিত্র বস্তুতে নির্দিষ্ট কী বিদ্যমান থাকলে এই ফাংশনটি সত্য ফেরত দেয় অন্যথায় এটি মিথ্যা ফেরত দেয়।

সিনট্যাক্স

এর সিনট্যাক্স নিম্নরূপ

mapVar.delete()

উদাহরণ

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var mapVar = new Map();
      mapVar.set('1', 'Java');
      mapVar.set('2', 'JavaFX');
      mapVar.set('3', 'HBase');
      mapVar.set('4', 'Neo4j');
      var map = mapVar.delete('4');
      document.write("Size of the map object: "+mapVar.size);
   </script>
</body>
</html>

আউটপুট

Size of the map object: 3

উদাহরণ

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var mapVar = new Map();
      mapVar.set('1', 'Java');
      mapVar.set('2', 'JavaFX');
      mapVar.set('3', 'HBase');
      mapVar.set('4', 'Neo4j');
      var map = mapVar.delete('4');
      document.write(map);
      document.write("<br>");
      document.write("Size of the map object: "+mapVar.size);
      document.write("<br>");
      var map = mapVar.delete('5');
      document.write(map);
      document.write("<br>");
      document.write("Size of the map object: "+mapVar.size);
   </script>
</body>
</html>

আউটপুট

true
Size of the map object: 3
false
Size of the map object: 3

  1. জাভাস্ক্রিপ্ট নম্বর ফাংশন

  2. জাভাস্ক্রিপ্টে ম্যাপ অবজেক্ট।

  3. জাভাস্ক্রিপ্টে ফাংশন প্রোটোটাইপ

  4. জাভাস্ক্রিপ্টে ফাংশন ধার করা।