W3Schools JavaScript primer is a fantastic resource for learning the language. Today, we'll explore a core concept: key-value pairs in JavaScript, focusing on their declaration, retrieval, and manipulation.

JavaScript, like other programming languages, widely uses key-value pairs. It enables us to create dynamic and complex data structures efficiently.

Defining Key-Value Pairs
JavaScript supports two primary methods for declaring key-value pairs: objects and Maps.

Objects, introduced in JavaScript 1.0, are widely used and come with some-built-in behaviors. Maps, introduced in ES6, are more flexible and better suited for complex use-cases.
Using Objects

Objects in JavaScript are defined using braces {} and keys are separated from their values by a colon :.
Here's a simple example: ```javascript let person = {firstName: "John", lastName: "Doe"}; ```
Using Maps

Maps are defined using the new Map() constructor. Keys can be of any type.
Let's declare a Map with string and numeric keys: ```javascript let myMap = new Map([['key1', 'value1'], [42, 'forty-two']]); ```
Accessing and Altering Key-Value Pairs

Receiving values from objects and Maps requires different syntax.
- Objects: object.key or object['key']
- Maps: map.get(key)
Updating values also varies:
- Objects: object.key = 'new value'
- Maps: map.set(key, 'new value')




















Object Example
Let's update our 'person' object: ```javascript person.firstName = "Jane"; ```
Map Example
Now, let's update our 'myMap': ```javascript myMap.set('key1', 'new value'); ```
JavaScript's dynamic typing and `in` operator (`key in object` or `object.has(key)` for Maps) make key-value pair operations flexible. Now, you're equipped to leverage key-value pairs in your JavaScript development.
Continue exploring on W3Schools to broaden your understanding and master more JavaScript concepts. Happy coding!