All Questions
309 questions
0
votes
0
answers
25
views
Audio player won't play to previous song from an array of music
For the past week I've been coding this music website project, and my main goal is to make my own audio controller without using the HTML <audio> tag.
Instead, in JS, I made an object function ...
0
votes
0
answers
41
views
Do global variables carry their values assigned in one function in all other functions too
I am a new in programming.
I have a question about global variables. I am a little confused on how the variable I declared globally and assigned it a value in my first button handler function works in ...
-1
votes
1
answer
90
views
JS function repeating
const myLibrary = [];
function Book(title, author, numPages, readStatus) {
// Constructor for a book Object
this.title = title;
this.author = author;
this.numPages = ...
-1
votes
1
answer
52
views
How can I use Array find method in JavaScript: expected undefined to equal '2015'?
I am trying to write a function that uses find() to return the year of superbowl win ("W"). This is the array object
const record = [
{ year: "2018", result: "N/A"},
{ ...
0
votes
2
answers
699
views
Function takes in a search string and a list of books and returns all of the books that match the search input (STUCK)
I have been given a task that I can't seem to wrap my head around to complete successfully and need some help with writing the code to complete the task. Any help getting this accomplished would be ...
0
votes
1
answer
21
views
Make object key as value and assign new key to value in array of objects
I have an array of objects with multiple properties. I want to be able to make the property's key a value and assign a new key to my value.
My code:
var list = [
{
you: 100,
me: 75,
...
0
votes
0
answers
24
views
Send value to function and send back result to initial function [duplicate]
I have 2 functions and I want to send values back and forth to each other.
const higher_fnc = (query_name) => {
return axios({
url: GraphQL_Endpoint,
method: "post",
headers:...
1
vote
1
answer
35
views
Accessing parameter from Javascript Function
I am using highcharts 4 javascript library.
In highcharts, you can customize the buttons for the chart.
Chart with custom button
The way to do that is to push the buttons (as an object) in an array ...
-2
votes
2
answers
169
views
In an array object how to change only value on second level
I have an array object i want to change the value of isFavorite to true only in second level (where name is pear) i tried map function but that is changing value on every level and i have written that ...
-1
votes
2
answers
3k
views
TS2556: A spread argument must either have a tuple type or be passed to a rest parameter. Using in Object.assign
So I have this function:
export default function getObjectFromTwoArrays(keyArr: Array<any>, valueArr: Array<any>) {
// StartPoint:
// [key1,key2,key3],
// [value1,value2,value3]
/...
2
votes
1
answer
37
views
I'm trying to remove duplicate data from a new array, but am returning array of individual characters instead. What can I do differently?
I have an array of objects saved to:
const arrayOfCustomerObjects
I need to return an array of States based on an array of objects that lists data including address information. In addition, each ...
0
votes
0
answers
209
views
Create array of objects from graphql response
I have a response from graphql that I want to reformat and assign to a variable so that I can keep using them across my app.
GraphQL response:
{
"data": {
"organization"...
1
vote
2
answers
35
views
Call a function from a other Object
I get data from a MongoDB. This data is collected in a array by the ngOnInit() method. All the data is collected how i said in a array which type is a object. This object is outside of the app....
1
vote
1
answer
149
views
Display Paginated Objects on screen
I have an Array of Objects:
const myArray = [
{myObject: "1"},
{myObject: "2"},
{myObject: "3"},
{myObject: "4"},
{myObject: "5"},
...
0
votes
1
answer
113
views
Sort and display an Array of Objects JavaScript
I have created a function to dislpay the objects in an Array.
let shownObjects = myArray;
function showTheObjects(displayedObjects) {
document.getElementByID('divToDisplayObjects').innerHTML = &...