+2 votes
in Programming Languages & Algorithms by
name/value pair in a JavaScript context

1 Answer

+1 vote
by (13.6k points)
Best answer

The name-value pair also known as the attribute-value pair is a data representation technique that allows a name or attribute to be mapped to a specific value. While a name or attribute can be defined more than once, it must have only one value in any given context. It is also possible for a value to represent even more name-value pairs. 

An example is shown below:

Website = 'CPEN Talk'

A collection of name-value pairs is what is known as an object. 

See an example below:


            Url: 'https://cpentalk.com',

             About: 'Computer Science & Engineering Q&A',

             Question 1034:{

                       Question title: 'What is a name-value pair',

                       Question content: 'name/value pair in a JavaScript context'