Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

key

How to update a value, given a key in a hashmap?

September 8, 2022 by Tarik

map.put(key, map.get(key) + 1); should be fine. It will update the value for the existing mapping. Note that this uses auto-boxing. With the help of map.get(key) we get the value of corresponding key, then you can update with your requirement. Here I am updating to increment value by 1.

Categories java Tags hashmap, java, key Leave a comment

How to efficiently count the number of keys/properties of an object in JavaScript

August 27, 2022 by Tarik

To do this in any ES5-compatible environment, such as Node.js, Chrome, Internet Explorer 9+, Firefox 4+, or Safari 5+: Object.keys(obj).length Browser compatibility Object.keys documentation (includes a method you can add to non-ES5 browsers)

Categories javascript Tags count, javascript, key, performance, properties Leave a comment
Newer posts
← Previous Page1 … Page18 Page19

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa