@HamesRodrigues Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
``` i dont know why this code does not give me desired code when i run it on my compiler as it gives the output "modifiedstring" as same as input and not the correct output which shud be having only one B as the code decreases the number of B from the input Please help guys please
function adjustLetterCount(inputString, letter, adjustment) { // Split the input string into individual characters const characters = inputString.split(' ');
// Initialize a variable to keep track of the count of the letter
function adjustLetterCount(inputString, letter, adjustment) {
// Split the input string into individual
// characters
const characters = inputString.split(' ');
// Initialize a variable to keep track of
// the count of the letter
ok stackoverflow literally hates my indentation haha
Does anyone else ever feel this specific scenario?
For example, I'll feel my heart beating in the background (it's just ambient/background noise), and then when I notice my heart beat and pay attention to it, my heart rate slows down quite a lot.
This sort of reminds me of the stopped-clock illus...
your first if statement checks if the currentLetter is equal to letter as passed by parameter
ie letter='B'
but currentLetter isnt capable of ever being B from the input string
so it passes to the else block, which simple adds character to replacedString
character is determined from your first split(' ');
then you return replacedString and its equal to the input string
there are some oddities here also
adjustment starts with a value of -1
only ever gets decreased, but you have a check to see if its ever greater than 0
im afraid i cant even guess what you would like the output to be
did you want to take one B out of the input string or something?
@ParkingMaster, yeah that happens to me, not that i have heart palpitations or a heart arrhythmia or anything
also if youre quite fit and you take a deep breath your heart will slow down a little because you have extra oxygen in your blood so its doesnt need to work so hard
someone could either be quite fit or quite slim for that scenario
@matt Didn't know this happened to anyone else because no one ever mentions it. And yeah, I noticed that when taking a deep breath, my heart slows down temporarily, and then it goes back to its normal pace.
@matt For me it's Firefox. It's made by Mozilla which I like, and it's kind of easier for developers than using chrome. It's also just a bias opinion because Firefox was the first browser I ever used and I hate change so I just stick with it.
The only issue I've ever had is that it's slower than chrome when it comes to WebGL/Three.js rendering. It's a little slower than chrome.
The latest version of Edge is causing some issues: there are pages that used to work well 2 weeks ago. Now, the same pages, without any modifications to the code, are hanging when we click buttons. These pages work fine in Chrome
@underscore Well, whatever %HaveSameMap is must be wrong.. Both a and b are different. a has a different primitive value, b has a different object defined.
The Dev channel is being updated to OS version: 15853.4.0 Browser version: 125.0.6422.5 for most ChromeOS devices. If you find new issues, please let us know one of the following ways File a bugVisit our ChromeOS communitiesGeneral: Chromebook Help CommunityBeta Specific: ChromeOS Beta Help CommunityReport an issue or send feedback on ChromeInterested in switching …
@1.21gigawatts Don't think so. Maybe they've added something like template strings in more recent versions but I've not kept up after 10. I've used MessageFormat in the past which is reasonably close to template strings. There is also String.format() and Formatter but the options are more complex and less readable (well, more like printf() in C/C++).
It's more of the "holy grail" of OO. At least I've only really seen it exalted in that regard. And it's not completely untrue. C# would be the equivalent but is less OO-ish. Well, with lambdas and other features...which Java also has now, so... the two languages are back to being close again.
@1.21gigawatts Or sort of both. It seems a lot of people pick it up because of its popularity. And it's popular because web projects are popular. Also, web projects are "easy" (or marketed as easy), so more people want easy money. Hence why they get into JS, which is also often their first programming experience, thus more questions about "why doesn't it work". Etc., etc.,
@1.21gigawatts It does. From before JS, I believe.
At any rate, the precise semantics are a bit different but in practice, it's almost interchangeable with JS.
@1.21gigawatts Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
Should be possible. Not really sure how, though - I've never player around with it. But node can have bindings for other code - usually written in C/C++ but some modules are also written in Python or R or other languages. So, in theory, I don't see why Java won't be an option. I've never really looked into how it works or how to make it work, though.
You could also do something like spin a server in Java, call it with HTTP calls to localhost on Node.
Probably look into Spring Boot if you want to do that.
If you go down that route, you should be able to set it up in Maven. Note: I don't know how easy it would be, just that it should be possible. In Maven you should be able to have a pom that pulls the Node project, then builds it (if needed) and starts it, then starts up the Spring Boot project. Then the two can start communicating.
That's also an option. Depends on how you want to consume it.
The "old school" way of debugging it is to put a public static void main(String[] args) method in the file you want to check, then run it (since you can run any file which has a method with this signature). In the main method you'd put some code that runs whatever you want to try.
Kotlin is suppored to be "the better version" of Java. If that helps. Well, AFAIK, it's not Java but still executes on the JVM and should be similar at least.
When calling a JAR? AFAIK, you should get each argument in args in the main method.
Although, TBQH, I've never actually used the args array for more than one argument. And I might have used the args array once. Or twice. I don't have a lot of first hand experience.
I'd expect calling myJar arg1 arg2 arg3 to give you three args in the main method.
@1.21gigawatts It's not great. Very messy and not easy to enforce a proper API. Although, it's at least simple. Simpler than running an HTTP API which you then need to call.