Skip to main content
3 votes
2 answers
185 views

I am trying to make a basic notes app using JS. I am storing notes in localStorage, and I am trying to print those notes using for-in loop. It works mostly fine, but I don’t know why I am getting ...
-4 votes
3 answers
110 views

I wrote the algorithm below and asked an AI to evaluate my solution. //TESTS: console.log(firstNonRepeatingCharacter('abacabaz')) //c console.log(firstNonRepeatingCharacter('aabbccdeefgghijj')) //d ...
1 vote
1 answer
162 views

I hope this is not a silly question. Why when I use for (let property in myObject)... property is recognized by typescript as "string" instead of "keyof typeof myObject"? Is there ...
-2 votes
1 answer
41 views

I'm new to React. I know that comments should be received as an object, so I tried using a for...in loop to iterate over them. However, when I attempted to use the for...in loop, I encountered an ...
2 votes
4 answers
129 views

var myArray = new Array(); var increment = 0; myArray.push('Tom Hanks', 'Pierce Brosnan', 'Will Smith', 'Richard Ayoade'); for (actor in myArray) { console.log(actor + ' is my #' + increment + ' ...
8 votes
5 answers
5k views

I would like to make some properties of an object to be hidden and some to be visible on iteration. So I tried to use prototype but that's not working: ​function Car(){} Car.prototype.version = '1.0'...
1 vote
1 answer
240 views

import SwiftUI import MapKit import CoreLocation struct ContentView: View { @State private var position: MapCameraPosition = .userLocation(fallback: .automatic) @State private var hazards: [(...
2 votes
2 answers
325 views

I have Data Structure like this const array = [ [["first_name" , "First"], ["image" , "image"]], [["email" , "email"]], [["...
1 vote
3 answers
628 views

I came across such statements as the following in Matt Neuburg's iOS 13 Programming Fundamentals with Swift: When you cycle through a sequence with for...in, what you’re actually cycling through is a ...
11 votes
5 answers
9k views

I'm trying to figure out how to add an itertor to a javascript class such that the class could be used in a for...in loop. Following the instructions from Mozilla doesn't produce the results they ...
0 votes
1 answer
41 views

Still learning JS and confused over this The below code gives out undefined as output when it should be "v" - am I missing something or using for-in over a string is the issue let s="...
0 votes
3 answers
149 views

I'm new to Delphi but am experienced in C# an would normally think this is a pretty easy thing to do but am getting a "E2430 for-in statement cannot operate on collection type 'Class reference'" ...
-3 votes
3 answers
148 views

I'm new to JavaScript and am learning about for...in loops and objects right now. I'm practicing with the following example: let spaceship = { crew: { captain: { name: 'Lily', ...
5 votes
7 answers
28k views

To return an array set with a sequence of random numbers between 1 and 500 I tried to refactor a standard for loop for(var i = 0; i< 50; i++) and that worked but when I tried to do a refactor using ...
0 votes
3 answers
72 views

I tried looping names of front-end developers nested inside of objects(refer to code) and when I printed it to console it says display is not defined. var employees = { sales: { ...

15 30 50 per page
1
2 3 4 5
41